Scripting reference · Nerdamer Language
while
Repeats an expression while a condition is true.
The condition is checked before each pass. while returns the value of the last pass.
Scripting
while(condition, body)
Write it in a script: nerdamer('block(x:0,while(3-x,x:x+1),x)'), or in the Playground.
Parameters
condition- Checked before each pass; the loop stops when it is false.
body- The expression to repeat. Use
blockfor several steps.
Examples
Good to know
break()leaves the loop andcontinue()skips to the next pass.- If the body never runs,
whilehas no value, and using it as one is an error. - A loop stops with an error after
MAX_LOOP_ITERATIONSpasses (1,000,000 by default); see Settings.
