|
| |
Karel 15
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 IfBot so that
- it knows to turns green when facing south and white when
facing north.
- before it moves it checks to see if a wall is in front. If
it is clear, it moves otherwise, it stays put.
- if it is more than 10 streets from the origin it dies from
home sickness.
- if it is more than 10 avenues from the origin it dies from
home sickness.
|
| |
Check the documentation
to see which methods will:
- check to see if
a wall is in front;
- give you the
street, and
- give you the
avenue.
Examine the Robot documentation
|
|