Steppable *unbump =
    new StickyIf(
        new BumpedQ(the_robot),
        new Prog(
            NULL,
            new Moveby(the_robot, -0.1),
            new Turnby(the_robot, PI/2)
        ),
        do_the_other_stuff
    );

Example 1: Simple reactive program implemented as a collection of decision trees.

Back to Article
Copyright © 1999, Dr. Dobb's Journal