|
Wyo Java Ch7Proj4 |
|
Extend Ch7Proj3 with the additional specifications. Just before each move, a fish has a 1/5 probability of dying. When a fish dies, he should no longer be displayed in the environment. That is, when a fish dies, do not output his ID number, location, and direction. His location is immediately opened up allowing the other fish to move to that location. Instantiate the fish in the same locations and with the same directions as in Ch7Proj2. Do not seed any Random objects that you might use. Be sure to display your name & the name of the assignment as the first line of your output. Here is a sample output screen.
Notice that the fish #2 eventually moves to the location (0, 0) which was the last location of the dead fish #1. The printscreen that you submit for a grade must show the one fish inhabiting the location where the other fish died. You may have to execute your program many times before this output occurs. Your program must follow the class Coding Standards. Save all of the files associated with this assignment to a folder named Ch7Proj4 in the appropriate network folder. Preconditions:
You must hand in the following on separate pages stapled in this specified order:
|