Blackjack C++ Sample play

    Welcome to Blackjack! Have fun playing!

Goal: Reach 21 without going over

The House (computer player) will be playing against you

If the House busts (goes over), you win.

If the House doesn't bust, you win, if your
total value is greater than the House's

If the player gets 21 and the House doesn't
the player is a winner

If a player and the House both get 21
it is declared a push (tie)

c = clubs, d = diamonds, h = hearts, s = spadesCode language: PHP (php)

The Dealer deals two cards to the house and reveals one: 5 of Diamonds
The Dealer deals you two cards: Jack of Spades Queen of Clubs
Player cards: Jack of Spades Queen of Clubs
Player tally:20
Stand, or hit you with another card? (S or H)s
Push!
Player cards: Jack of Spades Queen of Clubs
Player tally:20
Dealer cards: 5 of Diamonds Jack of Clubs 5 of Spades
Dealer tally:20
Wins:0 Lose:0 Draw:1
Hit [Q]uit or [C]ontinue:c
The Dealer deals two cards to the house and reveals one: 7 of Spades
The Dealer deals you two cards: Jack of Clubs Queen of Diamonds
Player cards: Jack of Clubs Queen of Diamonds
Player tally:20
Stand, or hit you with another card? (S or H)s
Your score higher – you win!
Player cards: Jack of Clubs Queen of Diamonds
Player tally:20
Dealer cards: 7 of Spades 10 of Spades
Dealer tally:17
Wins:1 Lose:0 Draw:1
Hit [Q]uit or [C]ontinue:c
The Dealer deals two cards to the house and reveals one: 7 of Diamonds
The Dealer deals you two cards: 8 of Hearts 7 of Clubs
Player cards: 8 of Hearts 7 of Clubs
Player tally:15
Stand, or hit you with another card? (S or H)h
You Bust!
Player cards: 8 of Hearts 7 of Clubs 9 of Hearts
Player tally:24
Dealer cards: 7 of Diamonds 6 of Diamonds King of Clubs
Dealer tally:23
Wins:1 Lose:1 Draw:1
Hit [Q]uit or [C]ontinue:c
The Dealer deals two cards to the house and reveals one: 9 of Clubs
The Dealer deals you two cards: Ace of Hearts 10 of Clubs
Player cards: Ace of Hearts 10 of Clubs
Player tally:21
Stand, or hit you with another card? (S or H)s
You win!
Player cards: Ace of Hearts 10 of Clubs
Player tally:21
Dealer cards: 9 of Clubs Queen of Hearts
Dealer tally:19
Wins:2 Lose:1 Draw:1
Hit [Q]uit or [C]ontinue:c
The Dealer deals two cards to the house and reveals one: King of Spades
The Dealer deals you two cards: 9 of Hearts 6 of Spades
Player cards: 9 of Hearts 6 of Spades
Player tally:15
Stand, or hit you with another card? (S or H)h
Player cards: 9 of Hearts 6 of Spades 2 of Clubs
Player tally:17
Stand, or hit you with another card? (S or H)s
House score higher, house wins
Player cards: 9 of Hearts 6 of Spades 2 of Clubs
Player tally:17
Dealer cards: King of Spades 10 of Clubs
Dealer tally:20
Wins:2 Lose:2 Draw:1
Hit [Q]uit or [C]ontinue:q

Scroll to Top