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