User:OrenBochman/Lua Loops
Loops
editDo Block
editdo
...
end
Do While Loop
editwhile cond do
...
end
Repeat Loop
editrepeat
...
until cond
For Loop - Numeric
edit- variable i is local to the loop block
for i = start, stop do
...
end
For Loop - Generic
edit- uses a keyword - in
- variable i is local to the loop block
for i in iterator do
...
end
- iterator is a function returning a list of remaining values. Standard iteritors are
- Pairs
- iPairs