Beepers


1. Beep! Beep!

Reeborg's world includes beepers. These are small objects (drawn fairly big on the screen) that make a small beeping sound when they are turned on. Reeborg can only hear beepers if he is standing right next to them. He can pick them up and carry them (turned off) in his pockets, or he can put them down (turning them on automatically).

You can instruct Reeborg to pick up beepers, through the pick_beeper() command, or to put some down, through the put_beeper() command. If you ask Reeborg to pick up beepers where there are none, or to put down beepers if he doesn't carry any, he will complain and shut down.

Your turn

Open up the world file beepers1.wld, which should look like the picture below on the left. You open a world file by clicking on the open world button button. Write a program that will have Reeborg pick up the beeper, and put it down after carrying it as illustrated.

beeper1 lead to beeper2 (2K)


2. Changing beepers

You can easily change Reeborg's world by adding beepers. To do so, you just "right-click" on any intersection and select the number of beepers from 0 (used to remove any beepers present) to 20.

Your turn

Open up the world file beepers1.wld, and increase the number of beepers at the corner of the third avenue and first street from 1 to 5. Save this world file under the name beepers2.wld by clicking on the save world button button. Write a program that will have Reeborg pick up all the beepers and then take one step away.

previous Making a left turn - home - Darn bugs! next
../images/SourceForge.net Logo