Right-Hand Rule maze algorithm
The Right-Hand Rule walks with its right hand on the wall. It's the mirror image of the Wall Follower and explores the maze in the opposite order.
How it works
At every step it tries to turn right, then straight, then left, then turns around. Like its left-handed twin, it needs no memory and always gets out when the start and exit are on the outer wall.
On loops round an inner island it can walk forever, so MazeSim stops it the moment it repeats a position and heading, and shows it as lost.
What to watch for
Race it against the left-hand Wall Follower on the same maze: they sweep the walls in opposite directions and one is often much luckier.
Properties
- Shortest path
- No
- Finds the exit
- Yes, when start and exit are on the outer wall
- Explores
- Often a lot of the maze
- Memory
- None
Race it
Pick it in the race and see who reaches the exit first, or run it in the studio.
FAQ
Is right hand better than left hand?
Neither is better in general; which one is faster depends entirely on where the exit is in that particular maze.