Lua Programming/How to Lua/while

A while loop is a conditional loop that repeatedly executes a block of instructions whilst the condition is true. In lua, the while statement is used together with do and end syntactical cocomponents to produce a while loop:

l = 0
while l < 10 do
  print (l)
  l = l + 1
end
Last modified on 30 May 2011, at 22:27