It looks like you're new here. If you want to get involved, click one of these buttons!
local map = {} for line in io.lines("map1.txt") do map[#map + 1] = line end local mapid = {} for r = 1, #map do mapid[r] = {} for c = 1, #map[r] do mapid[r][#mapid[r] + 1] = "x" end end |
Comments
https://www.lua.org/gems/sample.pdf
Likes: MoKaLux
For my problem I simply do:
Likes: MoKaLux
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
BTW: my initial purpose was not to optimize but to simplify my loops because it seemed to me that those two loops could be merged into one, but I was wrong. I still have a lot to learn regarding lua and gideros.
https://www.lua.org/pil/contents.html
(I stopped taking them somewhere in the middle but I feel like I should continue my treatment)
Likes: MoKaLux
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)