=========================================================================== Rules for the game of blackjack (simplified) =========================================================================== Objective - Collect a hand of cards totalling as close to 21 as possible, without going over. Up to 4 players play individually against a dealer's hand (the dealer plays a different hand against each player). The server is always the dealer for the purposes of this assignment. A "round" consists of a complete hand played with up to 4 players. With each round, the dealer begins play with a standard, randomly shuffled deck of 52 cards. Cards are dealt and are not returned to the deck after play (until the beginning of the next round). Before any cards are dealt, each player makes a bet. The bet amount cannot be changed once a hand is dealt (the bet is deducted from the player's funds immediately). Any player winning his or her hand receives double the amount originally bet (i.e. for $20 bet, $40 is credited to the player's available funds); if the player loses, no money is paid out (the original bet, already deducted, is lost). The value of a hand is determined by the spot value of the cards, with face cards counting as 10, and an ACE as either 1 or 11, whichever is most beneficial to the player (e.g. [ 7 K A ] == [ 7 A ] == 18). Once all players have bet, for each player, 2 cards are dealt to the player and 1 card is dealt to the dealer (thus the dealer has up to 4 hands, one for each player with whom it is playing). These cards are dealt "face up", so the dealer's first card is known to the player. The individual players now play their hands. They do that independently, by signaling their "bid" to the dealer. A player may choose to either STAND (satisfied with current hand) or request a HIT (another card). If after receiving a card, the player's hand totals more than 21, the player is BUST and loses the hand. Players may take as many hits as they like until they either choose to stand or go bust. Once all players have either gone bust or choose to stand, the dealer displays its hand to each player in turn. The dealer plays according to the current value of its hand: HIT - if hand <= 16 STAND - if hand >= 17, or player went bust NOTE: dealer automatically stands if a player goes bust (i.e. dealer wins). If dealer goes bust the player wins. Otherwise, once the dealer stands the higher valued hand wins with ties going to the dealer. At this point a "round" is complete, and a new round begins with a new group of players (some may be the same ones of course), and a new freshly shuffled deck of cards. Example Round: After all bets are placed and the initial cards dealt: Player 1 Player 2 Player 3 Player 4 JD TH 2C 5D AS 5C JS 9S Dealer Dealer Dealer Dealer 2H 7D 9H 3D After all Player actions (received in any order): Player 1 Player 2 Player 3 Player 4 JD TH 2C 5D AS 5C JS 9S Stand Hit 3S Hit AC Stand Hit 6C Hit TC Hit 6S Stand Bust Dealer Dealer Dealer Dealer 2H 7D 9H 3D After all Dealer actions: Player 1 Player 2 Player 3 Player 4 JD TH 2C 5D AS 5C JS 9S Stand Hit 3S Hit AC Stand Hit 6C Hit TC Hit 6S Stand Bust Dealer Dealer Dealer Dealer 2H 7D 9H 3D KH 4D 3C QC AH AD Bust 3H Player wins Dealer wins Dealer wins Player wins