Adding cards back into deck
I should be able to figure this out, but I'm completely lost.
The following code deals to a hand of choice a set number of cards (int toDeal):
Code :
private void deal(Hand hand, int toDeal)
{
for (int j = 0; j < toDeal; j++)
{
Hand temp = hand.handCards();
Card[] s = new Card[temp.getNumCards() + 1];
Card[] q = hand.getHand();
for (int k = 0; k < temp.getNumCards(); k++)
{
s[k] = q[k];
}
s[s.length - 1] = deck.dealCard();
hand.setHand(s);
}
}
to call it I run:
How do I make a method to add these cards back into the deck (the cards from the temp array)?
Thank you,
any ideas or code greatly appreciated
-sp4ce
Re: Adding cards back into deck
Your question is not clear to me , if it is possible can you make it more clear.