Navigate a Maze

5 points

In this program, you program the Karel robot to independently navigate a maze. In an earlier program, you created a maze and invited a human user to navigate the maze. In another earlier program, you programmed Karel to leap over a series of hurdles. In this program, you combine those 2 earlier programs by programming Karel to navigate a maze. The good news is that it should be easy to do this. The code that you wrote to get Karel to jump the hurdles should also enable Karel to navigate a maze.

If you find that the code that you wrote earlier doesn't enable Karel to navigate the maze, you'll need to modify the code. The basic principle of navigating a maze is that the robot (or whoever it is) should consistently hug the right wall. This will lead out of the maze. This will probably not be the most efficient route out of the maze, but it will eventually work.


Starting Point

Start with the program you wrote to get Karel to jump a series of hurdles. Use World.readWorld() to open up the maze you created earlier.