Robot Antics |
It is expected that you have - at the very least - begun problems 1 - 4 on page 95. Once you have completed those four problems, please program the four tasks below, placing them in a class named "Mover" which is an extension of the "Robot" class. (Mover.kpp) |
Task A: "remove6BlocksOfBeepers()" |
This method must remove all the beepers on the next six blocks. |
Task B: "move5BlocksMax()" |
This method must move 5 blocks unless stopped by a wall. If there is a wall, have your robot stop WITHOUT the program crashing. |
Tasks C: "chooseDirection()" |
This method should have the robot turn in the opposite direction if he is on the same corner as another robot, or simply continue in the same direction if he is not. |
Task D: "getAroundWall()" |
This method should allow your robot to get around a wall segment if one blocks its path. When the method concludes, the robot should appear as though it jumped over the wall! Therefore it must face the correct direction and be in the right place. |
As you complete each task, you should create a "task" block at the bottom of the Mover Class file that tests it. Alter the world as needed to try different scenarios. |