CMC logo Cave Man Code

zug

also written: while

Loops

Keep doing something while a check stays gronk.

How to write it

zug <check>
    <things to do>
unga

What it does

zug checks before every lap. If the check is gronk, it does the things inside and checks again.

When the check becomes nork, the loop stops.

Example

grunk fuel = 3

zug fuel > 0
    oga "Zoom! fuel left:", fuel
    fuel = fuel - 1
unga

oga "Out of fuel."

Tips

See also

booga · zoop · unga

Back to all words