15-100
Lab 3: Karel
Problems
Lab 3 Due Date: Wednesday September 26 at midnight
Background:
Using the software design and problem-solving techniques
we have been exploring in Karel, do one of the following three problems.
Your solution must be able to solve general examples of the situations,
not just the specific task contained in the template files. You will be
able to download the template files for each problem
-
Program a robot named Karel to go on a treasure hunt. A corner
containing five beepers marks the treasure. Other corners (including the
corner on which Karel starts) contain clues, with each clue indicating
in which direction Karel should proceed. The clues are as follows: one
beeper means that Karel should go north, two means west, three means south,
and four means east. Karel should follow the clues until it reaches the
treasure corner, where the robot should turn itself off. See the figure
below for an example of one possible treasure hunt.
Download Template TreasureHunter.zip
-
A robot named Karel is inside a completely enclosed room
with no doors or windows, as shown in the figure below. The robot is in
the southeast corner, facing south. There is one wall segment inside the
room with Karel. The wall segment blocks north-south travel and does not
touch the walls that form the room. One one side of the wall segment is
a beeper (which side is unknown). Program Karel to find and move the beeper
to the opposite side of the wall segment.
Download Template BeeperMover.zip
-
Program a robot named Karel to arrange vertical piles of
beepers into ascending order. Each avenue, starting at origin, will contain
a vertical pile of one or more beepers. The first empty avenue will
mark the end of the piles that need to be sorted. The figure below illustrates
one of the many possible initial and final situations.
Handing in your Solution
Your solutions should be in the form of .zip files. Take
the directories of your solution and place them inside a parent directory
called Lab3. Zip up this lab3 directory for submission. When we grade your
solution we will unzip the folder and execute the project. If your project
does not run you will lose the execution points for that lab.
Your Solution zip file must contain all the files in
your projects
Your teaching assistants will show you how to zip up the
files for submission. Instructions are also in the Tutorial
document that is available
Click on this link to Submit
your zip file |