circuit
¶(circuit traversal [times])
or
(repeat traversal [times])
Repeat a traversal a given number of times or as long as it succeeds. When it fails, stop.
"Move forward three times."
(symex-eval (symex-traversal (repeat (move forward) 3)))
"Keep moving forward."
(symex-eval (symex-traversal (repeat (move forward))))
"Keep moving down and forward, as long as we don’t descend to the root node."
(symex-eval (symex-traversal (repeat (carefully (try (move down) (move forward)) (afterwards (not (at root)))))))