sudo-rushil / elm-cards / Games.Blackjack

Scoring for Blackjack

Scoring

score : Deck.ShuffledDeck -> Basics.Int

Score the input hand.

Score calculated according to standard blackjack rules. If a hand has an ace that is, when scored as an eleven, causes the hand to exceed 21, the ace is acounted as a one.

score <| newDeck [ Card Spades Ten, Card Hearts Ace ] == 21

score <| newDeck [ Card Clubs Seven, Card Diamonds Queen ] == 17

score <| newDeck [ Card Spades Five, Card Diamonds Four, Card Clubs Ten, Card Hearts Ace ] == 20