Re: read textfile and save in a multidimensional table
Posted: Tue Oct 15, 2013 2:14 pm
Code: Select all
map={}
k=1
v=1
for line in love.filesystem.lines("labyrinth1.txt") do
map[k] = {}
for i in string.gmatch(line,"%S+") do
map[k][v] = tonumber(i)
v= v+1
end
k= k+1
v=1
end