sudo-rushil/elm-cards/2.0.1

NOTE: the latest version is 3.2.0

Games.Blackjack

Scoring for Blackjack

Scoring

score : Deck -> 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 [ Card Spades Ten, Card Hearts Ace ] == 21


score [ Card Clubs Seven, Card Diamonds Queen ] == 17


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