While Loops

While and repeat loops are, compared to for loops, much simpler. They work similarly to an if statement in that they only execute if a condition is met. The difference here is, of course, that a while loop will repeatedly execute its code while its condition is met, rather than only once.

Example to the right.

while condition do
--code here
end