|
| |
Karel 15d
Complete the following in class or for homework. Do NOT hand in your work unless other instructions were given.
| 1. |
The Robot class only comes with a frontIsClear() method.
Create a child of RobotSE by writing 3 more methods
in the CheckerRobotSE class called rightIsClear(), leftIsClear(), and backIsClear().
These methods check for walls in those new directions.
Make sure the robot is back in its original direction
after performing each of the methods. |
| 2. |
A CheckerRobotSE has been hired to carpet some rooms. A room is a corner
that has a wall segment immediately to the west, north, and east. The door
is to the south. The robot is to put a single Thing in room and on no other
corners. The robot starts with 8 things in its backpack. |
| |
 |
|