xxxxxxxxxx
# i start from 0 going to 4 "5 steps"
for i in range(5):
print(i)
# output
0
1
2
3
4
xxxxxxxxxx
-- In range loops are really easy to make.
-- It does not require pairs() or ipairs(), those are table iterations.
-- A in range loop is exactly as is:
for variable in 10 do
print(variable)
variable = variable + 1
end
-- If the above block fails it's purpose, the bottom block is a replacement.
for variable = 0, 1, 1 do
print(variable)
variable = variable + 1
end