Karel Level 7


Part 1

Your robot has been kidnapped! The kidnappers have placed Karel in a random maze. Your job is to escape. Reach the exit, which is marked on the map with a beeper.

Maze 0

Your code must work for any possible maze!

A sequence of steps that solves a problem.

A maze can be solved using the following algorithm:

Imagine you are standing in a maze.

  1. Place your hand on the wall to your left
  2. Walk forward while keeping your hand touching the wall at all times
  3. Follow turns with your hand still on the wall
  4. That's it! You're done when you reach the exit

This maze has been set up so that the robot will touch every square in the maze at least once before reaching the exit, if the algorithm has been written correctly.

Part 2

Press the corresponding number key on your keyboard to load a maze listed below.

Run your algorithm on each maze to make sure it works.

Maze 1
Maze 2
Maze 3
Maze 4
Maze 5