CS 117 Assignment: Sorted fish
Assigned Friday, 2/9/07.
Due Wednesday, 2/14/07 by 9:00 PM.
Just as in the Fish assignment, I want you to
generate 20 random fish. But this time, your program should do
the following:
- As before, generate 20 fish with random position
random direction (left or right), and random color (red, blue, green, or yellow)
and store them in an array of Fish.
- Draw the rightmost fish, pause 1/4 second, draw the second rightmost
fish, pause 1/4 second, etc. until all the fish have been drawn in
their original colors.
- Pause two seconds.
- Redraw the topmost fish in black, pause 1/4 second, redraw the second topmost
fish in black, pause 1/4 second, etc.
This will require that you (1) sort your array of fish in decreasing order
with respect to their x coordinates, (2) sort your array of fish in increasing
order with respect to their y coordinates,
Start early, have fun, and keep in touch.