Skip to content
This repository was archived by the owner on Jan 26, 2022. It is now read-only.
Peter Tillema edited this page Nov 26, 2018 · 2 revisions

While is the close sibling of Repeat. The difference here is, the condition is evaluated at the beginning of the loop, instead of at the end like Repeat. Another difference is that While checks for code to be true (any number other than 0) to run the loop. You can use Repeat if you want the code inside it to be run at least once, and you can use While if you want the code inside it to run only when the condition evaluates to true (and for however long the condition evaluates to true). Example:

0→A
While A<16777000
    rand→A
End

The example stores 0 into A, and then continually stores a random number into A, until the number is greater than or equal to 16777000. Once again, inefficient code but it's for example purposes.

Clone this wiki locally