Programming in greenfoot

i am writing the game Go Fish.
So far i have the background and a deck that deals out two hands of 5.
I want to be able to click on a card in one hand, and then compare it
to the 5 cards in the other hand and check if they are equal. (the
game only uses hearts and spades and there are two of each number with
the same suit so it has to be the same number and suit). If they are
equal i want the computer to remove the card from the two hands. Also,
if there are two cards that are the same in the two hands i want them
to remove themselves automaticaly. Below is the code i have for the
two hands. anyone have any ideas? or pointers


       Deck d = new Deck();
       d.shuffle();
       addObject(d, 4, 1);

       Card [] hand1 = new Card[5];
           for (int i = 0; i < 5; i++) {
               Card c = d.deal();
               hand1 [i] = c;
               addObject(c, 2+i, 3);
           }

       Card [] hand2 = new Card[5];
           for (int i = 0; i < 5; i++) {
               Card c = d.deal();
               hand2 [i] = c;
               addObject(c, 2+i, 5);

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to