This is in text form because I want to avoid any kind of formatting. Please focus on content. The problem: World Series of Blackjack The World Series of Blackjack is a tournament of 40 competitors vieing for the top prize of 500 000 dollars. The tournament features 40 top Blackjack players from 14 casinos from around the US. The tournament is being hosted this year at the Las Vegas Hilton and is being televised on the Game Show Network. In its third year the WSOB is going strong with the best field of competitors to date. Like last year the WSOB tournament is broken down into eight 5 player preliminary rounds followed by two semi-final rounds. There will be Wild card rounds and the tournament will wrap up with a Final round to determine the champion and winner of 500 000 dollars. Our program: Allows a number of players to play the game. This is an exercise in OOP. There are plenty of Blackjack applets out there with glitzy interface. User view: Here's how playing a typical game looks: C:\Users\dgerman\Desktop>java LasVegas Dealer gets Qh Player 1 gets 2s Player 2 gets Ks Player 3 gets Ad Dealer gets 3d Player 1 gets Jh Player 2 gets 5d Player 3 gets 2c Dealer with [Qh, 3d] worth 16 Player 1 with [2s, Jh] worth 14 Player 2 with [Ks, 5d] worth 19 Player 3 with [Ad, 2c] worth 13 -------------------------------- Dealer with [Qh, 3d] worth 16 Do I want a new card: yes Dealer gets 4s Dealer with [Qh, 3d, 4s] worth 20 Player 1 with [2s, Jh] worth 14 Do I want a new card? yes Player 1 gets 8c Player 1 with [2s, Jh, 8c] worth 22 Player 2 with [Ks, 5d] worth 19 Do I want a new card? yes Player 2 gets Qc Player 2 with [Ks, 5d, Qc] worth 32 Player 3 with [Ad, 2c] worth 13 Do I want a new card? yes Player 3 gets 5c Player 3 with [Ad, 2c, 5c] worth 18 -------------------------------- Dealer with [Qh, 3d, 4s] worth 20 Do I want a new card: no Player 1 with [2s, Jh, 8c] worth 22 Busted! I'm out of here. Player 2 with [Ks, 5d, Qc] worth 32 Busted! I'm out of here. Player 3 with [Ad, 2c, 5c] worth 18 Do I want a new card? yes Player 3 gets Jc Player 3 with [Ad, 2c, 5c, Jc] worth 20 -------------------------------- Dealer with [Qh, 3d, 4s] worth 20 Do I want a new card: no Player 1 with [2s, Jh, 8c] worth 22 Busted! I'm out of here. Player 2 with [Ks, 5d, Qc] worth 32 Busted! I'm out of here. Player 3 with [Ad, 2c, 5c, Jc] worth 20 Do I want a new card? no OK, if everybody's happy with their cards we're done. Now the program: class LasVegas { public static void main(String[] args) { Game g = new Game(4); g.play(); } } This is LasVegas.java and stands for the actual event. In it we create a Game with 4 players and we play it. class Game { Player[] p; // an array of Players is what a Game contains Game(int players) { // this is what it takes to initialize a Game. Note that one of the Players is a Dealer this.gameOn = true; this.p = new Player[players]; for (int i = 1; i < players; i++) this.p[i] = new Player("Player " + i, this); this.p[0] = new Dealer(this); } boolean gameOn; // this tells us if the game is on or off int pass; // this keeps track of how many Players in succession have denied taking another Card void play() { // this is how a Game is played: Deck d = new Deck(); // create a new Deck of Cards for (int i = 0; i < 2; i++) { for (Player player : this.p) player.takeCardFrom(d); // have each Player take two Cards } for (Player player : this.p) // let's take a look at them player.report(); for (int index = 0; this.gameOn; index = (index + 1) % this.p.length) { // now go around the players while the game is going on if (index == 0) System.out.println("----------------------------"); Player nextPlayer = this.p[index]; // identify the Players whose turn it is if (nextPlayer.wantsCard()) { // if (s)he wants cards nextPlayer.takeCardFrom(d); // have her/him take cards nextPlayer.report(); // then show us what (s)he got this.pass = 0; // then reset the counter for how many players have decided not to get a new card } else { // otherwise this player does not want (or can get) cards this.pass += 1; // so count this player as having passed the turn if (this.pass >= this.p.length) { // if that completes the number of players we need to stop the game this.endGameBecauseNobodyWantsCards(); // so we call that procedure } } } } void endGameBecauseDealerBusted() { // when the dealer busts the game goes off this.gameOn = false; // recall the loop in play watches this instance variable (which acts as a flag) System.out.println("Dealer busted, game over."); } void endGameBecauseNobodyWantsCards() { // when the players are all passing the game ends too this.gameOn = false; System.out.println("OK, if everybody's happy with their cards we're done."); } } This is Game.java which implements the actual game. import java.util.*; // a Player has a name, a Hand, uses a Scanner to talk to us and belongs to a Game class Player { String name; Hand hand; Scanner sc; Game g; Player(String name, Game game) { this.name = name; this.hand = new Hand(); this.sc = new Scanner(System.in); this.g = game; } void takeCardFrom(Deck d) { // taking cards from a Deck is straightforward as shown in class Card c = d.remove(0); System.out.println(" " + this.name + " gets " + c); this.hand.add(c); // cards are being stored in the Player's Hand } void report() { System.out.println(" " + this); } public String toString() { return this.name + " with " + this.hand + " worth " + this.hand.score(); } boolean busted() { return this.hand.score() > 21; // a Hand can determine its score } boolean wantsCard() { if (this.busted()) { System.out.println(this + "\n Busted! I'm out of here."); return false; } else { System.out.print(this + "\n Do I want a new card? "); return this.sc.nextLine().equalsIgnoreCase("yes"); } } } This the Player.java file. import java.util.*; class Deck extends ArrayList { Deck() { String[] suits = { "c", "d", "s", "h"}; String[] values = { "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" }; int[] points = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 12, 13, 14 }; for (String suit : suits) { for (int i = 0; i < values.length; i++) { this.add(new Card(suit, values[i], points[i])); } } Collections.shuffle(this); } } This is the Deck.java file. import java.util.*; class Hand extends ArrayList { int score() { int aces = 0; int sum = 0; for (Card c : this) { if (c.points == 1) aces += 1; sum += c.points; } while (aces > 0) { if (sum + 10 > 21) break; else { aces -= 1; sum += 10; } } return sum; } } This is the Hand.java file. Notice a Hand is asmall Deck (in some sense). They both rely on: class Card { String suit, value; int points; Card(String suit, String value, int points) { this.suit = suit; this.value = value; this.points = points; } public String toString() { return this.value + this.suit; } } This is Card.java and models a basic game card. The only thing that's left to show is the Dealer: class Dealer extends Player { Dealer(Game g) { super("Dealer", g); // call the Player constructor, the one from the super class } boolean wantsCard() { if (this.busted()) { this.g.endGameBecauseDealerBusted(); return false; } System.out.print(this + "\n Do I want a new card: "); int score = this.hand.score(); if (score < 17) { System.out.println("yes"); return true; } else { System.out.println("no"); return false; } } } This is Dealer.java and shows the Dealer as a special kind of Player. Probably the core of the entire development is the play() method of the Game object. From that most everything follows, like when solving an equation. Trying to see if what I posted here made it through with no typos and errors I create: LasVegas.java Game.java Player.java Deck.java Hand.java Card.java Dealer.java Then I compile and run: -bash-3.2$ javac LasVegas.java -bash-3.2$ java LasVegas Dealer gets 9s Player 1 gets Ac Player 2 gets 6s Player 3 gets 10s Dealer gets 2s Player 1 gets 8s Player 2 gets Kh Player 3 gets Jc Dealer with [9s, 2s] worth 11 Player 1 with [Ac, 8s] worth 19 Player 2 with [6s, Kh] worth 20 Player 3 with [10s, Jc] worth 22 ---------------------------- Dealer with [9s, 2s] worth 11 Do I want a new card: yes Dealer gets 2d Dealer with [9s, 2s, 2d] worth 13 Player 1 with [Ac, 8s] worth 19 Do I want a new card? no Player 2 with [6s, Kh] worth 20 Do I want a new card? no Player 3 with [10s, Jc] worth 22 Busted! I'm out of here. ---------------------------- Dealer with [9s, 2s, 2d] worth 13 Do I want a new card: yes Dealer gets Kc Dealer with [9s, 2s, 2d, Kc] worth 27 Player 1 with [Ac, 8s] worth 19 Do I want a new card? no Player 2 with [6s, Kh] worth 20 Do I want a new card? no Player 3 with [10s, Jc] worth 22 Busted! I'm out of here. ---------------------------- Dealer busted, game over. OK, if everybody's happy with their cards we're done. -bash-3.2$ So you see the basic structure in action and maybe you have two comments: a) when the game ends there's no information about who won etc. b) that a Player busts is not determined right away but only next time around Both of these can be easily adjusted but the focus is not on that. The focus is on the overall structure of the program. Still, if we make the following change in class Player (simply change that one line): void report() { System.out.println(" " + this + " Busted? " + (this.busted() ? "yes" : "no") ); } The game now works as follows: -bash-3.2$ java LasVegas Dealer gets 9s Player 1 gets 10s Player 2 gets 5h Player 3 gets Jh Dealer gets Qd Player 1 gets 7s Player 2 gets 9h Player 3 gets 6s Dealer with [9s, Qd] worth 22 Busted? yes Player 1 with [10s, 7s] worth 17 Busted? no Player 2 with [5h, 9h] worth 14 Busted? no Player 3 with [Jh, 6s] worth 18 Busted? no ---------------------------- Dealer busted, game over. -bash-3.2$ java LasVegas Dealer gets Qh Player 1 gets Kd Player 2 gets 4s Player 3 gets Jd Dealer gets 5d Player 1 gets 3s Player 2 gets 9s Player 3 gets 2c Dealer with [Qh, 5d] worth 18 Busted? no Player 1 with [Kd, 3s] worth 17 Busted? no Player 2 with [4s, 9s] worth 13 Busted? no Player 3 with [Jd, 2c] worth 14 Busted? no ---------------------------- Dealer with [Qh, 5d] worth 18 Do I want a new card: no Player 1 with [Kd, 3s] worth 17 Do I want a new card? yes Player 1 gets Ad Player 1 with [Kd, 3s, Ad] worth 18 Busted? no Player 2 with [4s, 9s] worth 13 Do I want a new card? yes Player 2 gets 5h Player 2 with [4s, 9s, 5h] worth 18 Busted? no Player 3 with [Jd, 2c] worth 14 Do I want a new card? yes Player 3 gets Jh Player 3 with [Jd, 2c, Jh] worth 26 Busted? yes ---------------------------- Dealer with [Qh, 5d] worth 18 Do I want a new card: no Player 1 with [Kd, 3s, Ad] worth 18 Do I want a new card? no Player 2 with [4s, 9s, 5h] worth 18 Do I want a new card? yes Player 2 gets As Player 2 with [4s, 9s, 5h, As] worth 19 Busted? no Player 3 with [Jd, 2c, Jh] worth 26 Busted! I'm out of here. ---------------------------- Dealer with [Qh, 5d] worth 18 Do I want a new card: no Player 1 with [Kd, 3s, Ad] worth 18 Do I want a new card? yes Player 1 gets 4h Player 1 with [Kd, 3s, Ad, 4h] worth 22 Busted? yes Player 2 with [4s, 9s, 5h, As] worth 19 Do I want a new card? no Player 3 with [Jd, 2c, Jh] worth 26 Busted! I'm out of here. ---------------------------- Dealer with [Qh, 5d] worth 18 Do I want a new card: no Player 1 with [Kd, 3s, Ad, 4h] worth 22 Busted! I'm out of here. OK, if everybody's happy with their cards we're done. So likely this looks a bit closer to how the game should be. Still, this is really unimportant here. The important thing to consider is the overall organization of the code. End of notes. P.S. When the game ends we should sort the array of Players to determine the winner. For that the Players should implement Comparable and state in compareTo() the rules for sorting: ascending order by points if not busted, descending order by points if busted, Players go ahead of Dealer when they have the same number of points, and alphabetically by name otherwise. --