/Blackjack

A c# program that lets you play blackjack.

Primary LanguageC#MIT LicenseMIT

Blackjack

⚠ㅤSplitting option is not available.

Index

The Objective of Blackjack

Beat The Dealer. There are some misconceptions about the objective of the game of blackjack but at the simplest level all you are trying to do is beat the dealer.

How do you beat the dealer?

  1. By drawing a hand value that is higher than the dealer’s hand value
  2. By the dealer drawing a hand value that goes over 21.
  3. By drawing a hand value of 21 on your first two cards, when the dealer does not.

How do you lose to the dealer?

  1. Your hand value exceeds 21.
  2. The dealers hand has a greater value than yours at the end of the round.

How Do You Find A Hand's Total Value?

Blackjack is played with a conventional deck of 52 playing cards and suits don’t matter.

  1. 2 through 10 count at face value, i.e. a 2 counts as two, a 9 counts as nine.
  2. Face cards (J,Q,K) count as 10.
  3. Ace can count as a 1 or an 11 depending on which value helps the hand the most.

Blackjack Card Values

2-9 count at face value, tens and face cards count as 10, and Aces count as 1 or 11.

How To Play

Here is the basic overview of a round of blackjack:

  1. Player Places a Wager
  2. Dealer Deals Cards to The Player
  3. Player Decides How to Play Hand
  4. Dealer Plays Hand
  5. Payouts

1. Player Places a Wager

At the start of a round the first thing you do is place a bet.

2. Dealer Deals Cards to The Player

After you place your bet the dealer will deal one card, face up, for either you or himself. Then he will deal one more card face up for you and one more card for himself, face down. You will have 2 cards, face up, but the dealer will have one card face up and one face down.

3. Player Decides How to Play Hand

The dealer will wait for you to play your hand. To play your hand, first you add the card values together and get a hand total anywhere from 4 to 21. If you’re dealt a ten-value card and an Ace as your first two cards that means you got a Blackjack! Congratulations! Those get paid 3 to 2 (or 1.5 times your wager) immediately, without playing through the round, as long as the dealer doesn’t also have a Blackjack. If the dealer also has a Blackjack, you wouldn’t win anything but you also wouldn’t lose your original wager. This is called a “push”. If YOU don’t have a Blackjack AND the dealer doesn’t have a blackjack, the dealer will wait for you to decide how you want to play your hand. There are 5 ways you can play your hand:

Double - If you have a hand total that is advantageous to you but you need to take an additional card you can double your initial wager and the dealer will deal you only 1 additional card.

Stand - If your first two cards are acceptable, you can stand and the dealer will move on to the next player.

Hit - If you would like more cards to improve your hand total, the dealer will deal you more cards, one at a time, until you either “bust” (go over 21) or you choose to stand. There is no limit on the number of cards you can take (other than going over a total of 21).

Split - If you’re dealt a pair (2 cards of equal value) you have the option to put out a second wager and the dealer will split the two cards so that each card will become the first card on two new hands. This also applies to face cards. You are allowed to split a hand consisting of a King and a Jack because they both have the same value, even though they are not actually a pair.

Fold - If you don’t like your initial hand, you have the option of giving it up in exchange for half your original bet back.

4. Dealer Plays Hand

I know what you’re thinking, “Oh my gosh, that’s a lot of options, how do I know which one is the best choice?” Well, that depends on the dealer’s “up-card” (the dealer card that is face up and visible to the players)

Basic Strategy

Blackjack Basic Strategy

Based on what the dealer is showing, and what you have in your hand, you make the choice that follows.

Player Hand Resolution

When you follow basic strategy and play your hand by using one of the 5(4) options listed above, one of 3 things will happen.

  1. You stood immediately - You were dealt a hand that basic strategy says you should not take any cards on.
  2. You made a hand - You took more cards (hit, double or split) and achieved a hand total of 21 or less and did not bust.
  3. Your hand is out of play - You hit your hand one or more times and “busted” or you chose to surrender your hand. If your hand busts you immediately lose your wager. This is why the casino has an edge on the game. The player must act first, so that even if the dealer eventually busts like you did, they still keep your money because you busted first.

If your hand hasn’t busted, and you didn’t surrender, then it’s time for the dealer to play their hand. The dealer will first flip over their “hole card” (the face down card) and add up their 2-card hand. If the dealer has a hand total of 17 or higher, they will automatically stand. If the dealer has a hand total of 16 or lower, they will take additional hit-cards. Doubling, splitting and surrender are not available to the dealer and the dealer does not have any choice with how they play their hand like the player does. The Dealer must play their hand the same way every time.

5. Payouts

Ok so you’re done playing your hand and the dealer is done playing their hand according to the restrictions above. One of 2 things will happen.

  1. The dealer will bust, and they will pay even money (1 times the wager) if you still in play. or…
  2. The dealer will make a hand (17 through 21). If your hand is still in play, it’s a simple battle of who has the higher hand. If the dealer has the higher hand, they sweep your bet. If you have the higher hand, the dealer pays you one times your wager. If you and the dealer have the same hand-total, it’s considered a “push” and you keep your money but are not paid on your wager.

Now the round is over! That’s all there is to it. The cards get swept up and you start another round.

Special Situations

There are a couple situations where a game of Blackjack will deviate from the procedures outlined above.

Insurance: Insurance is a side bet offered when the dealer has an ace as an up-card. Before anyone plays their hands the dealer will offer insurance. You can put up a wager equal to half your original wager, which will get paid 2 to 1 if the dealer has a ten as their hole card. So, put simply, you’re betting on whether or not the dealer has a blackjack. If you win, you get paid 2 to 1. As a basic strategy player you should always say no to insurance. After you have decided whether to buy insurance or not, the dealer will check her hole card. If he has a ten underneath, the dealer got a Blackjack, and will take your original wager. If you bought insurance, you will get paid 2 to 1 on your insurance wager. If the dealer does not have a ten underneath and you bought insurance, he will take your insurance wager, otherwise the game will continue like it normally would.

Non-Insurable Dealer Blackjack: It is possible for the dealer to have a blackjack without offering insurance. If the dealer is showing a ten up, they will check their hole card automatically, before anyone is allowed to play their hands. If there is an ace underneath, the dealer has a blackjack and your bet will be taken except if you have a blackjack, which would just push. Insurance is only offered when the dealer is showing an ace.

Dead hand: If you bust before the dealer plays their hand, it’s considered a “dead hand” and the dealer will flip over her hole card. There is no reason to play the dealer’s hand and waste cards because the dealer has already beaten the player.