Lover of life, just trying to become the best version of me...
Get notified when a new post is published.
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
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