May 2017
Intermediate to advanced
416 pages
21h 33m
English
Arrays can be implemented simply using tables with integer indexes. The table’s size does not need to be declared at the beginning, and can enlarge it as you need it to:
a={} for i=1,10 do a[i] = 0 end
Another example is as follows:
a = {4,5,6} print(a[1]) --will print 4 print(a[3]) --will print 6 a[5] = 9 --This assignment is valid. print(a[5]) --This will print 9
Read now
Unlock full access