CSE 111, Fall 2000

HW #4EC: KAREL THE ROBOT GETS DIZZY

Last Update: 2 October 2000

Note: NEW material is highlighted.

Suppose that Karel's initial situation is that he could be located anywhere on the grid, that he might (or might not) have some beepers in his bag, and that there are no walls.

Use top-down design and stepwise refinement to write a complete Karel program that has Karel empty his beeper bag on the corner that he is standing at, get dizzy (where getting dizzy consists of Karel turning right 100 times), and then go home (where home = the origin). It does not matter what direction Karel is facing when he gets home (he's too dizzy to care).

Suggestion:

To test your program, only have Karel turn right 10 times, not 100. But your final program should have him turn right 100 times.

THIS IS AN EXTRA-CREDIT ASSIGNMENT:
IT IS OPTIONAL, BUT,
IF YOU DO IT,
THEN THE GRADE YOU GET ON IT CAN REPLACE A LOW H.W. GRADE

NEWDUE: AT THE START OF LECTURE: FRI., OCT. 6NEW




Copyright © 2000 by William J. Rapaport (rapaport@cse.buffalo.edu)
file: 111F00/hw4ec.02oc00.html