A Question for those who have worked with The Marine Biology Case Study

Discussion in 'Computer Science & Culture' started by mgwisni, Feb 12, 2004.

Thread Status:
Not open for further replies.
  1. mgwisni Registered Member

    Messages:
    29
    If you have worked with the Marine Biology Case Study in Java, I could use some help with it. I need to figure out how I can compare the fish's color that the class is refering to, to it's neighbor's color. What I am trying to do is make it impossible for a red fish to eat another red fish, or a blue fish eat another blue fish, etc. If you could offer me any assistance, that'd be sweet.

    If you do not know what it is, but would like to see the program or help, you can download it here: Fishy
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Ender Registered Senior Member

    Messages:
    294
    Don't you at some point have a vector of all the spaces around the fish?

    So then just check the vector of all positions, and then if there is a fish, check to see if its color matches the origional fish. i'm not sure what the fuctions are called but it seems like it might be like fish.getColor().

    and then remove the fish that has the same color for an eatable list.

    Again I haven't looked at the fish code very much, but the concept is the same. If you have any question email me.

    remove the _FISH_ in the email address.

    jackwilsoniv@hotmail_FISH_.com
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
Thread Status:
Not open for further replies.

Share This Page