Not good at making subject titles, but here's the problem: I'm trying to pass a .txt file and parse it. The only thing though is that I want to print it to the screen. All goes well and dandy, but for some reason (probably obvious) it prints the first line of the file, then it proceeds to the first and second... straight across the string.
Example output:
Code: Select all
1 0 0 0
1 0 0 0 1 0 0 0 2
1 0 0 0 1 0 0 0 2 1 0 0 0
Of this .txt file:
Code: Select all
1,0,0,0,
1,0,0,0,2,
1,0,0,0,
I feel like I'm missing some simple knowledge of lua/logic, but I can't find a answer to it. Here's the for loop:
Code: Select all
y = 0
x = 0
for i=1,#num do
local v = num[i]
love.graphics.print(v, x, y)
x = x + 15
if v == "" then
y = y + 15
x = 0
end
end
Thanks a bunch,
- redsled