Exercises Based on Robot Bill

1. Modify the program in the Example to program Bill to pick up beepers if the wall sections are removed.
2. Write a new instruction for Bill named empty-beeper-bag. After Bill executes this, his beeper bag should be empty.
3. Write a new instruction for Bill named go-to-origin. This should position Bill on 1st street and 1 st avenue regardless of his initial position and the direction he is facing.
4. Write an instruction that faces Bill east if he is on a corner with an even number of beepers, and faces him west if he is on a corner with an odd number of beepers (zero is considered an even number).
5. Program Bill to run a Steeplechase. In this race the hurdles are arbitrarily high and arbitrarily wide. The finish is marked by a beeper, which Bill must pick up before turning himself off.




Back to Previous Page

Document:
Local Date:
Last Modified On: