Lua - while statement

Published 2014/03/03 by Admin in LUA

The while statement allows you to repeat a task until a certain condition is met.

a=1

--this is a comment

while a~= 5 do  -- Lua uses ~= to mean not equal 

a=a+1

io.write(a.." ")

end

Output:

2 3 4 5


my coding

This is a collection of all the coding gems I have found and would like to share with the world!