Control flow

when/if branches, while/until loops, for each, heel/again/bury.

Branches (when / if)

Branch starters: if, when, whenever, should. Must be heard at the start of a branch line (except otherwise when).

Then words: then, do. Else words: otherwise, instead, else.

Block end: bury, end, goodnight, enough, bedtime, lightsout, hush, done, finished.

Inline then (one line, no body lines)

LineParses asNeed to know
when she has 1 toy then heelIfChain + BreakNo bury for single inline step
when she has 2 toys then she woof "hi"IfChain + Print
when she has 3 toys then I bark "yes" otherwise I bark "no" buryIfChain + inline else
when Bimba has 3 treats then the human growls "Nothing left." otherwise bark "no"inline if + elsebury optional when all branches inline

Multiline then / else

LineParses asNeed to know
when she has 2 toys then + body + buryIfChainBody lines are normal statements
otherwise when she has 1 toy thensecond IfBranchElif (otherwise when)
otherwise + body + buryelseStepsFinal else

Story glue before print in branches

LineParses as
when Bimba has 3 treats then the human growls "Nothing left."IfChain + Print[GROWL]; words before verb are glue

Full condition grammar: Conditions.

Loops (while / until)

While starters: while, during. Until starters: until, till.

LineParses asNeed to know
while she has more than 0 toys thenburyWhileLoopMultiline body needs bury
until my labrador has 0 toys thenburyUntilLoopTrue condition → exit loop
while … when she has 1 toy then heelburynestedheel breaks innermost loop

Inline then (one heel, again, or print on same line) works without bury for that step only.

chaser trait: each loop iteration adds 1 toy before the body runs. See Traits.

Example from loops.woof:

when she has more than 2 toys then
    she woofs "Plenty."
    she misplaces a toy
otherwise when she has 1 toy then
    she woofs "Just one."
otherwise
    she woofs "None."
bury

while she has more than 0 toys then
    she woofs "Still going."
    she misplaces a toy
bury

For each (stash items)

Starters: for each … from … or for each … in …. Each word: each, every.

LineParses asNeed to know
for each snack from cookie_jar thenburyForEach[snack, cookie_jar]Variable name is any identifier
for each treat from her cookie jar thensameStory jar phrase resolves
for each snack from cookie_jar then bark snack buryinline bodyOne print on same line after then

Each stash item is bound to the variable for one iteration. Loop variable is the only other mutable name besides memory and journal.

Loop control

LineParses asSynonyms
heelBreakstop, stay, halt
againContinuerepeat, resume, onward
burycloses blockSee branch section for all bury words