Loops
for
loop
for
loopIn Hades, there is no C-style count-controlled loop, but only a foreach loop which iterates over an array.
Example
If you don't need a variable, you can use an underscore instead of naming a variable or variable declaration.
Range also has a shorthand: ..
.
Example
while
loop
while
loopThe while
loop pretty much works like you'd expect. It loops as long as a given condition evaluates to true
.
Example
stop
and skip
statements
stop
and skip
statementsThe stop
statement stops a loop.
Example
The skip
statement skips over the current state of a loop. In while
loops, this just skips execution of the code after the skip
statement. In a for
loop, this statement also skips to the next value of an array.
Example
Last updated