Blackjack Assignment

Blackjack is a card game in which the player tries to get as close to a total of 21 as possible without going over. A player is initially dealt two cards, and can choose to receive another card (known as choosing to “hit”) until deciding the total value of their cards is close enough to 21 to win.

The card dealer in Blackjack, however, does not get to choose what to do. The dealer automatically abides by a set of rules. If a dealer’s total is below 17, they must hit. If their total is between 17 and 21, they must stay. And if their total goes over 21, they automatically lose, known as having “busted”.

The game is played with a standard set of playing cards: the numbers 2 through 10, Jack, Queen, King, and Ace, each card appearing four times for a total of 52 cards. The number cards are all worth their number value (a “2” card is worth 2 points, a “5” card is worth 5, and so on). The Jack, Queen, and King are all worth 10 points. An Ace is worth 11 points, unless it would make the dealer bust, at which point it is then worth 1 point. If the first two cards dealt are an ace and a card worth 10 (the 10s, Jacks, Queens, or Kings), the dealer has a Blackjack and automatically wins.


2 = 2
3 = 3
4 = 4
5 = 5
6 = 6
7 = 7
8 = 8
9 = 9
10 = 10
Jack = 10
Queen = 10
King = 10
Ace = 10

Blackjack Game

Your first card is: Queen

Your second card is: Ace

Your total is 21. Blackjack! You win!

Your total is between 17 and 21. You can't hit anymore.