Page 2 of 2

Re: read textfile and save in a multidimensional table

Posted: Tue Oct 15, 2013 2:14 pm
by kikito
Just in case you are still stuck:

https://github.com/kikito/love-tile-tutorial/wiki

Re: read textfile and save in a multidimensional table

Posted: Wed Oct 16, 2013 8:39 pm
by nadula
Hi,
thank you all for the big help. It works and that's the code

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