My program creates a deck of cards and deals them all out to 4 different hands. This is my code. It creates the 4 hands and deals the cards to each of them.
Hand[] hands = new Hand[4];
for(int i=0; i<hands.length; i++){
hands[i] = new Hand();
}
for(int i=0; i<=Deck.size()+8; i++){
for(Hand hand : hands){
hand.addSingleCard(Deck.deal());
}
}
Now i have 4 hands, each with 13 cards, I want to iterate over the first hand, removing each card and add it to the second hand so Hand 1 has 0 cards and Hand 2 has 26. What is the best way to implement this?
Im self learning, so if you have a method thats different to what someone else has posted, i'd still love to see it :)
Handclass: how you get and remove cards.