Cool a fellow Lua coder!
But you don't necessarily have to use tostring() here, the following should work as well.
text = "" for i = 0,2 do text = text.."\n"..i..": " for i = 0,1 do text = text..i.." " end end print(text)
Lua always tries to convert the i here into a string when possible. I think nil wouldn't get converted, and obviously lists can't get converted.
The same should be possible when adding a string that only contains numbers to an integer, the string gets converted to a number automatically.
local ans = 12+"012" print(ans)
The 12+"012" returns 24 as a result, and so this prints in the next line.
The "012" get's converted to 12 as if you would do tonumber("012").
This usually saves some time when coding for me, so just a tip (I'm way to happy to see other people using lua XD)