I have a stupid/simple for loop question.
I try to skip a number in a loop by doing this:
for i=1, 10 do print("i = " .. i) if (i == 5) then i = i+1 end end
It’s a fairly common thing to do in C, but it seems to have no effect in lua.
The output is this:
i = 1
i = 2
i = 3
i = 4
i = 5
i = 6
i = 7
i = 8
i = 9
i = 10
Isn’t the two i’s in the same scope?
I haven’t been able to find lua examples where this is mentioned.