These exercises were developed after the book went to press. They were developed by the people named. Note that unless the solution calls for multiple robots, these problems can also be solved using Karel The Robot.
If you would like to submit a new exercise and have it published here, send it to me with a solution. Be sure to send me identifying information about yourself and a statement releasing it for publication. I will not publish the solutions, but will make them available to educators. berginf@pace.edu
1N. (Joseph Bergin, Pace University)
2N. (Joseph Bergin, Pace University)
1N. (Joseph Bergin, Pace University)
A robot named Ilya is in a square room with sides 8 blocks long. Ilya has 8 beepers in its beeperBag. Program Ilya to place the 8 beepers so that there is only one on each street, one on each avenue, and one on each diagonal (both left and right diagonals must be considered). This is a classic problem called "Eight Queens." Think of the beepers as queens on a chess board. Queens can move horizontally, vertically, and diagonally. Place 8 queens on a chessboard so that none of them can attack any of the others. HINT: Think recursively.
2N. (Joseph Bergin, Pace University)
3N. (Joseph Bergin, Pace University)
4N. (Joseph Bergin, Pace University)
Hint: use many classes and recursion. You do not need aliases for this exercise. The robots on the first seven streets will need to know the name of the robot on the street immediately to the north. Use local robots for this. Interestingly, all the robots can be named Garry.