Ok here is the game:

You play with two decks.

One deck of 52 is the Withdraw pile.

The other deck is split in half between the two player (each receiving 26 cards).

Player one draws a card from his deck of 26 and if the card's value is greater than 7, he draws that many cards from the withdraw pile. (Face cards count as 10 cards).

Example: Draw a Jack, draw 10 cards from the withdraw pile.

If the card is less than 7, you simply discard it.

Then the other player goes, and so on.

The game ends when the withdraw pile is gone.

The players both add up how many cards they have and the person with the least wins.

Simple enough.

Here is the code: (It is sort of pseudocode around the .add and .remove parts (you will see)- this is where I really need help. I'm looking for a sort of cut and paste feature, where I will "cut" the cards from the withdraw pile and "paste" them back to the player deck.

By the way, I already have card/deck/suit classes so that is where some of the features like .shuffle and .get are from. If you need to see any of those let me know...

thanks.

------------------------------


import java.util.*;

public class Halfandhalf {

public static void main(String[] args) {

Scanner reader = new Scanner(System.in);
Deck player = new Deck();

Deck withdraw = new Deck();
//System.out.print(player); //tests the deck

ArrayList<Card> playerOne = new ArrayList<Card>(); //Your hand
ArrayList<Card> computer = new ArrayList<Card>(); //computer's hand
ArrayList<Card> discard = new ArrayList<Card>(); //discard pile (empty)- fill with discarded cards (if < 7)

withdraw.shuffle();//shuffle
player.shuffle();

for(int x = 0; x < 26; x++){
playerOne.add(player.deal()); //deals 26 cards to each player
computer.add(player.deal());
}



while (withdraw.size()>0){
System.out.println("You draw");
System.out.println(playerOne.get(0));
if(playerOne.get(0).getRank()>7){ //if card value is greater than 7, draw that many cards from the withdraw pile into your hand

if(playerOne.get(0).getRank()==8){ //fix this later
withdraw.remove(8); //remove 8 cards from withdraw
playerOne.add(8); //add 8 to player's hand
}

if(playerOne.get(0).getRank()==9){
withdraw.remove(9);
playerOne.add(9);
}

if(playerOne.get(0).getRank()==10){
withdraw.remove(10);
playerOne.add(10);
}

if(playerOne.get(0).getRank()==11 || 12 || 13) //king,queen,jack count as 10 cards
withdraw.remove(10);
playerOne.add(10);

}

else if(playerOne.get(0).getRank()<7){
player.remove(0); //move the card to the discard arraylist
discard.add(0);
}


System.out.println("Opponent draws");
System.out.println(computer.get(0)); //basically the same thing for the opponent
if(computer.get(0).getRank()>7){

if(computer.get(0).getRank()==8){ //fix this later
withdraw.remove(8); //remove 8 cards from withdraw
computer.add(8); //add 8 to player's hand
}

if(computer.get(0).getRank()==9){
withdraw.remove(9);
computer.add(9);
}

if(computer.get(0).getRank()==10){
withdraw.remove(10);
computer.add(10);
}

if(computer.get(0).getRank()==11 || 12 || 13) //king,queen,jack count as 10 cards
withdraw.remove(10);
computer.add(10);

}

else if(computer.get(0).getRank()<7){ //Aces Count as 1
computer.remove(0); //move the card to the discard arraylist
discard.add(0);
}



}


}

}