|CIT 591 Assignment 8: Wator Applet Comments
Fall 2003, David Matuszek
Big fish don't eat algae. If a big fish moves to a location that contains algae, both of them coexist quite happily until the big fish moves away.
Please write an applet, not an applications. (I thought that was clear!)
I confusingly used "view" in two different senses:
I said that View (the class) should extend
Canvas. This is where you should do your drawing.
I said that the view should display the numbers of big fish, little fish, and algae, and the turn number. I did not mean to imply that these must be done in the View (Canvas). They are best done in a panel somewhere close to the Canvas.
Component. You will almost certainly want to use these
in order to calculate where to draw the various things in your ocean.
When you create the ocean (from the other half of the program), you specify the number of rows and columns. I expected these to be set somewhere in the "GUI half" of the program, but I did not intend for them to be settable by the user. You can the ocean size settable by the user if you want, but you certainly don't need to. (Personally, I would specify these in the HTML file as parameters to be passed to the Applet, but you can do what you like.)
I forgot to specify how fish reproduction happens. If it is time for a fish to reproduce, and if the fish can move to an adjacent location, then one of those two locations contains the parent fish, and the other location contains the child fish. This is why the fish has to be able to move--we need two adjacent locations for the two fish. I don't care if the parent moves and the baby is left behind, or if the parent stays put and the child gets the adjacent square--that's an unimportant detail.
The "baby" fish is little if the parent is little; it is big if the parent is big. These are two different species. The baby is not at all hungry when it is first born, so it has the full "starvation period" before it needs to eat.
Please do not give your source code to anyone. (Your partners are welcome
to see your source code, but don't give away copies.) You can give your
.class files to your partners--that's all they need in order to
use your half of the assignment to make a working program.