public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
02-19-2006, 11:46 AM
carrotderek
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
02-19-2006, 11:46 AM
carrotderek
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
02-19-2006, 11:46 AM
carrotderek
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
02-19-2006, 11:47 AM
carrotderek
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
02-19-2006, 11:47 AM
carrotderek
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
02-19-2006, 11:47 AM
carrotderek
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
02-19-2006, 11:47 AM
carrotderek
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
02-19-2006, 11:47 AM
carrotderek
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
02-19-2006, 11:47 AM
carrotderek
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt
}
public class EvenUpB { //handles the essentials of the even-up game
public static int score = 0; //score is initialized to 0
static Deck tableau = new Deck(); // make a new deck of cards of 52 cards
static Deck hand = new Deck(); // make an empty deck for the hand
static Deck waste = new Deck(); //make an empty dec for wastepile
public static void loadIt(){ //Loads the deck of cards in hand
hand.loadDeck(TestDeck.STACKED); //loads the test deck
hand.shuffle(); //shuffles the deck
tableau.push(hand.pop()); //puts a card from hand into the tableau
}
public static void deckDisplay(Deck deck){ //displays a deck as a row
Deck temp = new Deck(); //new temporary deck
Card toDisplay; //cards to display
if(deck.isEmpty()){ //if deck is empty
System.out.println("--");
}
else
while(!deck.isEmpty()); //while the deck is not empty
temp.push(deck.pop());
while(!deck.isEmpty()){ //while the deck is still not empty
toDisplay = temp.pop(); //cards are the cards popped from the temporary deck
deck.push(toDisplay);
System.out.println(toDisplay.show()+ ""); //display the cards
}
}//deckDisplay
public static void cardDisplay(){ //displays the cards to the user
System.out.print("Hand: " + hand.peek().show()); //prints out the hand deck; looks at the top card and displays it
/*Deals a card*/
public static void dealIt(){ //deals out a new card from hand deck
if(hand.isEmpty()){ //if the hand is empty, displays error message.
System.out.println("************ERROR************* *****");
System.out.println("The hand is empty, cannot deal en empty deck.");
System.out.println("Please load a deck and then deal.");
}
else{
tableau.push(hand.pop()); //takes the top card from hand and puts it in the tableau
}
}//dealIt