CMSC 280
Fall 2017
Carpet Hallways
Due:  Tue, August 29

Relevant Reading:

Chapters 1 and 2 of the KarelJRobot book.

  • Note that in some early versions of the book, in Chapter 2, there are several places where the street or avenue are off by one. For instance, on page 11, the Initial Situation in Figure 2.3 shows the robot on street 2, while the text below says it should be on street 1.
  • Also, we will be using Robot rather than UrRobot.

Assignment: (worth 5 exercise points)

NOTE: If you have done this program for another course in the past or this course, you must re-do this homework, you are not permitted to hand in your previous code.

Get file. Use the files in this folder as your basis for this assignment.

Run the program as given and see the world that you are given. In this world are 4 "hallways" indicated by wall segments. You are to write a program that has 4 robots "carpet" those hallways by placing one beeper on each intersection within the hallways.

Detailed Specifications:
  • There must be a separate robot responsible for each hallway.
  • Each Robot object must start or begin outside of the hallway.
  • Each Robot object must finish or end outside of the hallway.
  • The carpet must consist of one beeper per intersection and only one beeper per intersection (beepers are expensive).
  • There should be no Error Shutoffs.
  • Each Robot object must be turned off when the program terminates (the cost of energy is high).

Empty Hallways
Carpeted Hallways
Note that the robots might end in different places,
as long as they are outside of the hallway.

  • Remember that you are permitted to talk with others regarding how the program works. However, you need to do the actual work yourself and understand the answer that you produce.
  • Put your name in the comment at the top of the file. Also, put in the top of the file a note saying what the most difficult part of this homework was.


  • Go to your Workspace folder.  
  • Create a Zip file of the folder containing your work.
  • Submit that file to Canvas