|
| |
Karel 16: WhileBot
Complete the following in class or for homework. Do NOT hand in your work unless other instructions were given.
| 1. |
Add to the capabilities of WhileBot so that it
- pick up every Thing that is in a pile
- put down every Thing that is in it's backpack
- can move back to avenue 0 (assume the way is clear)
- can move back to street 0 (assume the way is clear)
|
| 2. |
More difficult(??) Do these if you get #1 done in
a reasonable amount of time. You may have to test for a couple of things in
the method. If you need to use the idea of more than 1 condition to control
a while loop (or if statement) you can look at this
page.
- Move towards avenue 0 but if a wall is in your way you can
go around it. Assume that there is only one wall in the way.
- Move towards street 0 but if a wall is in your way you can
go around it. Assume that there is only one wall in the way.
|
|