#how would I turn (for example) a 1, 9 into 1,2,3,4,5,6,7,8,9?
18 messages · Page 1 of 1 (latest)
;compile
for i=1, 9, 1 do
print(i)
end```
Program Output
1
2
3
4
5
6
7
8
9
Dwifte#2517 | lua | lua-5.4.3 | wandbox.org
@main plank is there a way to turn the entire thing into a table?
;compile
local list = {}
for i=1, 9, 1 do
table.push(list,i)
end
print(list)```
Program Output
/opt/wandbox/lua-5.4.3/bin/lua: prog.lua:4: field 'push' is not callable (a nil value)
stack traceback:
prog.lua:4: in main chunk
[C]: in ?
Dwifte#2517 | lua | lua-5.4.3 | wandbox.org
ooo
;compile
local list = {}
for i=1, 9, 1 do
table.insert(list,i)
end
print(list)```
Program Output
table: 0x556a7d70f390
Dwifte#2517 | lua | lua-5.4.3 | wandbox.org
ooo
wont show the table
;compile
local list = {}
for i=1, 9, 1 do
table.insert(list,i)
end
print(tostring(list))```
Program Output
table: 0x56541ebf9ee0
Dwifte#2517 | lua | lua-5.4.3 | wandbox.org
ill try it
should give you like {1,2,3,4,5,6,7,8,9}
alr thanks so much man