Game - * deck and four new players. Then it deals out the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/******************************************************************************* * Discription: Creats a game of cards ******************************************************************************/ public class Game { String[] players = new String[] { "Dr. Zoiburg", "President Obama", "Daniel", "Cynthia" }; CardHand[] hands = new CardHand[4]; CardDeck deck; /************************************************************************** * Game() - constructor that runs the game. It creates a new shuffled
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: * deck and four new players. Then it deals out the cards and * displays the results. **************************************************************************/ public Game() { deck = new CardDeck(); d for(int i = 0; i < players.length; i++) { hands[i] = new CardHand(players[i].toString()); } for(int b=0; b<13; b++) { for(int a=0; a<hands.length; a++) { hands[a].addCard(deck.getCard()); } } for(int a=0; a<hands.length; a++) { hands[a].displayHand(); } } }...
View Full Document

This note was uploaded on 10/19/2010 for the course CS 161 taught by Professor Wallace during the Fall '08 term at Oregon State.

Ask a homework question - tutors are online