[{"name":"Cards","comment":" Card datatypes and views\n\nUse these for defining card-specifc game logic or for displaying specific cards.\n\n\n# Types\n\n@docs Suit, Face, Card\n\n\n# Construction\n\n@docs new, defaultNew\n\n\n# Views\n\n@docs viewCard\n\n","unions":[{"name":"Card","comment":" A playing card type.\n\nCan either hold a card of suit and face, or a blank card.\n\nFace numbers are designated from 1 to 13 for A-K. Games which treat the ace differently can specify their behavior through the game logic.\n\nThe blank variant is useful for displaying cards that have not been flipped over, for instance.\n\n    aceOfSpades =\n        Card Spades Ace\n\n    blankCard =\n        Back\n\n","args":[],"cases":[["Card",["Cards.Suit","Cards.Face"]],["Back",[]]]},{"name":"Face","comment":" A playing card face type.\n\nLike the suit type above, this is useful for matching on different card faces, and does not induce an implicit order.\n\n","args":[],"cases":[["Ace",[]],["Two",[]],["Three",[]],["Four",[]],["Five",[]],["Six",[]],["Seven",[]],["Eight",[]],["Nine",[]],["Ten",[]],["Jack",[]],["Queen",[]],["King",[]]]},{"name":"Suit","comment":" A playing card suit type.\n\nUseful for pattern matching behavior of different games that are based on the suit of the card.\n\n","args":[],"cases":[["Spades",[]],["Diamonds",[]],["Clubs",[]],["Hearts",[]]]}],"aliases":[],"values":[{"name":"defaultNew","comment":" Construct a new card with a default argument.\n\nThe first input is the default card to use if construction fails.\n\nThe remaining two inputs correspond to the two inputs for [Cards.new](Cards#new).\n\n    defaultNew Back \"spades\" 1 == Card Spades Ace\n\n    defaultNew Back \"SPADES\" 1 == Card Spades Ace\n\n    defaultNew Back \"horses\" 1 == Back\n\n    defaultNew Back \"spades\" 0 == Back\n\n","type":"Cards.Card -> String.String -> Basics.Int -> Cards.Card"},{"name":"new","comment":" Construct a new card.\n\nThe first argument must be one of \"spades\", \"diamonds\", \"clubs\", or \"hearts\" (any case) for the card suit.\n\nThe second argument must be an integer from 1 to 13 for A-K.\n\nUse [Cards.defaultNew](Cards#defaultNew) if you want a `Card` instead of a `Maybe Card`.\n\n    new \"spades\" 1 == Just (Card Spades Ace)\n\n    new \"SPADES\" 1 == Just (Card Spades Ace)\n\n    new \"horses\" 1 == Nothing\n\n    new \"spades\" 0 == Nothing\n\n","type":"String.String -> Basics.Int -> Maybe.Maybe Cards.Card"},{"name":"viewCard","comment":" Return the color and unicode string for a `Card`.\n\nUse this function to write Html views for cards or decks.\n\n    viewCard (defaultNew Back \"spades\" 1) == ( \"black\", \"🂡\" )\n\n    viewCard (defaultNew Back \"hearts\" 7) == ( \"red\", \"🃗\" )\n\n","type":"Cards.Card -> ( String.String, String.String )"}],"binops":[]},{"name":"Deck","comment":" Deck types, generators, and manipulating functions\n\n\n# Types\n\n@docs Deck\n\n\n# Construction\n\n@docs fullSuit, fullFace, fullDeck, randomDeck\n\n\n# Manipulation\n\n@docs appendCard\n\n","unions":[],"aliases":[{"name":"Deck","comment":" A representation of an arbitrary deck or hand of cards.\n","args":[],"type":"List.List Cards.Card"}],"values":[{"name":"appendCard","comment":" Add a card to the end of the deck.\n\n    appendCard (Card Spades Ace) [ Card Spades Three, Card Spades Two ] == [ Card Spades Three, Card Spades Two, Card Spades Ace ]\n\n","type":"Cards.Card -> Deck.Deck -> Deck.Deck"},{"name":"fullDeck","comment":" A full 52-card deck in standard order.\n\n    fullDeck == [ Card Spades Ace, Card Spades Two, ... ]\n\n","type":"Deck.Deck"},{"name":"fullFace","comment":" Make a deck of all the cards for a single face.\n\nMakes the deck in standard order.\n\n    fullFace Ace == [ Card Spades Ace, Card Diamonds Ace, Card Clubs Ace, Card Hearts Ace ]\n\n","type":"Cards.Face -> Deck.Deck"},{"name":"fullSuit","comment":" Make a deck of all the cards in a single suit.\n\nMakes the deck in A-K order\n\n    fullSuit Spades == [ Card Spades Ace, Card Spades Two, Card Spades Three, Card Spades Four, Card Spades Five, Card Spades Six, Card Spades Seven, Card Spades Eight, Card Spades Nine, Card Spades Ten, Card Spades Jack, Card Spades Queen, Card Spades King ]\n\n","type":"Cards.Suit -> Deck.Deck"},{"name":"randomDeck","comment":" A 52-card deck in randomly shuffled order.\n\n    type Msg = ShuffleDeck Deck\n    Random.generate ShuffleDeck randomDeck\n\n","type":"Random.Generator Deck.Deck"}],"binops":[]},{"name":"Games.Blackjack","comment":" Scoring for Blackjack\n\n\n# Scoring\n\n@docs score\n\n","unions":[],"aliases":[],"values":[{"name":"score","comment":" Score the input hand.\n\nScore 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.\n\n    score [ Card Spades Ten, Card Hearts Ace ] == 21\n\n    score [ Card Clubs Seven, Card Diamonds Queen ] == 17\n\n    score [ Card Spades Five, Card Diamonds Four, Card Clubs Ten, Card Hearts Ace ] == 20\n\n","type":"Deck.Deck -> Basics.Int"}],"binops":[]}]