A Robot Gardener

Due Date:  Monday February 14, 2000 at 8:00 am

Assignment:
The budget is in the red. No kidding. We are broke. In order to cover the funding shortfall, we are going to put some robots to work as gardeners. Our robot gardeners will plant a lovely species of flower called beepers -- you knew this, right? The garden plots will be one mile long (8 blocks) along the southern boundary wall starting at the origin. Develop a custom class of robot that can plant a border of beepers along the wall.

Oh - there is one more itsy bitsy detail - there may be some "irregularities" along the southern wall and these "irregularities" must also have beepers planted in front of them. Since we are worried about the budget, you must insure that only one beeper in planted on a corner. Never put two beepers on the same corner! Give this gardener robot exactly 24 beepers since that is the most that would ever be needed for this type of job.

We know what you are thinking, "What is an irregularity?"

For this problem an "irregularity" is a wall segment or set of wall segments running North/South that are connected to the southern boundary wall. We are guaranteed that these wall segments are in lengths of only 1, 2, or 3 wall segments. We just don't know how many there are or how long they are in advance.

Background
We are definitely beyond the "get acquainted" mode. There are many possible designs that solve this problem. Some are very elegant and some rather clumsy. You are not being graded for the degree of elegance or clumsiness in your code - yet... As with Lab 4 this is a good group project BUT you must do your own coding. You cannot share code.

Your Gardener class must be in a .r file and your task list must be in a .kpp file. You cannot use 8 robots. That is just too expensive. You must do this with one lonely little robot.
 

Handin Instructions:
Create a folder named with your last name (and first if needed), section letter and the number 5.
e.g.
SmurffPappa.A.5
Put copies of your .r file, .kpp file and at least three worlds for testing to
/afs/andrew.cmu.edu/course/15/120/handin/lab5


15-120 Spring 2000                                                                   Lab 5

Back to 15-120 Assignments