Please enable JavaScript to use CodeHS

  • Karel
  • Autograded
  • Beginners

Karel Maze Runner

In this project, students will use control structures to help Karel implement the right-hand rule to successfully navigate a maze.

Easy

2 Hours

High School

Middle School

Project Description

One of the most common approaches to navigating a maze is called the “right-hand rule.” This rule states that, upon immediately entering a maze, if you reach out your right hand to touch the wall on your right, and follow that wall without breaking contact, you will always successfully find the exit to the maze.

In this project, you need to write a program that helps Karel navigate each of the five maze worlds using the right-hand rule. Karel will always start on the exterior wall and needs to “exit” the maze by finding and picking up the tennis ball, and turning to face East. You can assume that the tennis ball “exit” will also be on an exterior wall and not in any wall “islands” (sections of walls not connected to any other walls).

Project Demo

Explore this program before assigning it!

Project Overview

Here is an outline of the project activities: