I have this flowchart (this code obviously does not work)
for i = 1,10 do
local ["item" .. i] = i
end
for v = 1,10 do
print([item .. v])
end
So this will print out the numbers 1 to 10 - I want the 'i' for loop to create 10 variables with names "item1", "item2" etc.. with values 1,2 etc.. The 'v' loop will then loop through these 10 variables and print their values.
Can this be done? And if so, how? |