Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Obviously, the hard part in making a maze-solving robot which uses memory is the programming. Our Maze Solver uses the algorithm we briefly described in the “Applying Other Strategies” section for tracking your path. This method is called Tremaux’s algorithm. Before we get into the actual RobotC code, we will describe some concepts and assumptions needed for the program.
First, we define four “directions”—north, west, south, and east. These directions do not have to coincide with the actual four winds. Let’s call the direction of our robot at the entrance “North,” and let the other directions follow the usual convention. The current “direction” will be held in a variable called MyDir. The following code snippet declares the directions and some useful macros to find which direction is to the left/right of another direction: