92AM / blackjack

Simple game of blackjack using HTML, Bootstrap and core JavaScript.
https://92am.github.io/blackjack/
0 stars 0 forks source link

Dealer hits on blackjack #1

Closed Frezzle closed 5 years ago

Frezzle commented 5 years ago

Steps to reproduce

  1. Game starts like this:
    
    Dealer has : 
    Ace of Hearts
    Ten of Clubs
    (score :21)

Player has : Four of Spades Five of Clubs (score :9)


2. Press `Hit Me`, resulting in below:

Dealer has : Ace of Hearts Ten of Clubs Four of Diamonds Eight of Hearts (score :23)

Player has : Four of Spades Five of Clubs Ten of Hearts (score :19)

YOU WIN !!!



### Actual behaviour

Dealer hits/busts, and player wins.

### Expected behaviour

Dealer should instantly win before player can hit/stay, because dealer has blackjack when player does not.

### System config

Chrome 71.0.3578.98 (Official Build) (64-bit)
92AM commented 5 years ago

This issue is fixed, please find breakdown below.

Dealer wins instantly if they get blackjack (21) :

Dealer has : 
Ace of Hearts
King of Hearts
(score :21)

Player has : 
King of Hearts
Seven of Hearts
(score :17)

DEALER WINS !!!

Player wins instantly if they get blackjack (21) :

Dealer has : 
King of Spades
Four of Clubs
(score :14)

Player has : 
Ace of Diamonds
Jack of Hearts
(score :21)

YOU WIN !!!

A 'Draw' functionality is added. If the player and dealer both ends up with blackjack (21) then DRAW !!! is displayed :

Dealer has : 
Ace of Hearts
Jack of Clubs
(score :21)

Player has : 
Queen of Hearts
Ace of Clubs
(score :21)

DRAW !!!