B. User Manual

The objective of the game is to accumulate a “hand” of cards with a total value of 21 or less.  The winner of the game is the player who’s “hands” has a higher value than the dealer. For the card value, aces can be worth 1 or 11, depending on how the player wants to play it. Court cards, i.e. Jacks, Queens, and Kings have a value of 10. The rest of the card have the same value as their face.

To play the game:

  1. Make sure all the components of the game (the main code, all the supporting functions, the card graphics – the “sprites”, as well as the simple game engine .m file) are located at current MATLAB  workspace directory.
  2. Open the main game code (the Black_Jack_Code_Sprites.m file).
  3. Left-click the Run button.
  4. Note the user prompt in the Command Window; enter any amount of money that you wish to place in your pool; press Enter.
  5. Note another user prompt in the Command Window; place any amount of money that you wish to bet; press Enter.
  6. A Graphical User Interface in the form of pop-up screens with a retro-style “sprite”cards will appear with dealer’s initial hand and then the players initial hand.
  7. Once a card is dealt to the player, each time the player is faced with a prompt to enter one from three possible choices:  “Hit”, which means the player wants to draw another card from the deck, “stand”, which means the player does not want to draw another card from the deck, and  “double down”, which gives the player the opportunity to increase his / her bet by 100% and draw one additional card. (NOTE: enter “H” to “hit”, “S” to “stand”, and “D” to “double down”. The program is case sensitive, and the above choices must be entered using capital letters.) 
  8. The player can exit the game at the end of any round by entering 0, when prompted to enter another bet amount.
  9. The hands are displayed graphically in on the right side of the screen and the results are shown in the Command Window. Money wagered and lost or won is either added to or subtracted from the overall pool of money. If the player’s pool value is greater than zero, the player is prompted to bet again. If the player’s pool is zero or negative, the system displays this information to the player in the Command Window and the game is automatically ended.

The Rules of Blackjack:

The following excerpt comes from an excellent book by a British mathematician and a quant, Paul Wilmott, “Paul Wilmott Introduces Quantitative Finance” (see the Reference section).

“Before any cards are dealt, the player must place his bet in front of his table position. The dealer deals two cards to each of the players, and two to himself (one of the dealer’s cards is dealt face up and the other face down). This is the state of play shown in the figure. Court cards (kings, queens and jacks) count as 10, ace counts as either one or 11 and all other cards are counted at their face value. The value of the ace is chosen by the player. The aim of the game for the player is to hold a card count greater than that of the dealer without exceeding 21 (going ‘bust’). If the player’s first two cards are an ace and a 10-count card he has what is known as ‘blackjack’ or a natural. If he gets a natural with his first two cards the player wins, unless the dealer also has a natural, in which case it is a standoff or tie (a ‘push’) and no money changes hands. A winning natural pays the player 3 to 2. Working clockwise around the table from his immediate left the dealer asks each player in turn whether they want to hit or stand. ‘Hit’ means to draw another card. ‘Stand’ means no more cards are taken. If the player hits and busts, his wager is lost. The player can keep taking cards until he is satisfied with his count or busts. The player also has other decisions to make. The player is also allowed to double the bet on his first two cards and draw one additional card only. This is called ‘doubling down.’If the first two cards a player is dealt are a pair, he may split them into two separate hands, bet the same amount on each and then play them as two distinct hands. This is called ‘splitting pairs.’ Aces can receive only one additional card. After splitting, ace + 10 counts as 21 and not as blackjack. If the dealer’s up card is an ace, the player may take insurance, a bet not exceeding one half of his original bet. If the dealer’s down card is a 10-count card, the player wins 2 to 1. Any other card means a win for the dealer. It is sometimes permitted to ‘surrender’ your bet. When permitted, a player may give
up his first two cards and lose only one half of his original bet. The dealer has no decisions to make. He must always follow very simple rules when it comes to hitting or standing. He must draw on 16 and stand on 17. In some casinos, the dealer is required to draw on soft 17 (a hand in which an ace counts as 11, not one). Regardless of the total the player has, the dealer must play this way. In a tie no money is won or lost, but the bet stays on the table for the next round.” [2]