Skip to Main Content
The Art of LEGO MINDSTORMS NXT-G Programming
book

The Art of LEGO MINDSTORMS NXT-G Programming

by Terry Griffin
August 2010
Intermediate to advanced content levelIntermediate to advanced
288 pages
13h 21m
English
No Starch Press
Content preview from The Art of LEGO MINDSTORMS NXT-G Programming

solving a maze

There are many well-known approaches to solving a maze. For this program, you will use a method known as the right-hand rule algorithm. (An algorithm is a set of instructions for solving a problem.) As the TriBot moves through the maze, it will always follow the wall to its right, going through any opening on that side.

The right-hand rule algorithm works for mazes without tunnels or bridges and where the start and end points are at the edges of the maze (this method won’t work for a maze where the goal is to get to the center). As long as the maze fits these criteria, the robot is guaranteed to find the exit.

Figure 7-4 shows an example maze with the path followed using the right-hand rule. To help you understand how this rule works, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Art of LEGO MINDSTORMS EV3 Programming (Full Color)

The Art of LEGO MINDSTORMS EV3 Programming (Full Color)

Terry Griffin

Publisher Resources

ISBN: 9781593272180Errata