Copyright | (c) 2017 Christopher A. Gorski |
---|---|
License | MIT |
Maintainer | Christopher A. Gorski <cgorski@cgorski.org> |
Safe Haskell | Safe |
Language | Haskell2010 |
The Game.Game.Poker module defines structures and operations for a standard set of 52 playing cards.
- data PlayingCard = PlayingCard Rank Suit
- data Rank
- data Suit
- randomRank :: RandomGen m => Rand m Rank
- randomRankR :: RandomGen m => Rank -> Rank -> Rand m Rank
- randomSuit :: RandomGen m => Rand m Suit
- randomSuitR :: RandomGen m => Suit -> Suit -> Rand m Suit
- ranks :: [Rank]
- nRanks :: Int
- toRank :: PlayingCard -> Rank
- toRankLst :: [PlayingCard] -> [Rank]
- suits :: [Suit]
- nSuits :: Int
- toSuit :: PlayingCard -> Suit
- uniqueNumList :: RandomGen g => Int -> Int -> Int -> Rand g (Maybe [Int])
- uniqueNumLists :: RandomGen g => [Int] -> Int -> Int -> Rand g (Maybe [[Int]])
Documentation
data PlayingCard Source #
A representation of a standard playing card, distinguishable by rank and suit.
The rank of a standard playing card.
The suit of a standard playing card.
randomRank :: RandomGen m => Rand m Rank Source #
Returns a random standard playing card rank, with Ace low.
randomRankR :: RandomGen m => Rank -> Rank -> Rand m Rank Source #
Returns a random standard playing card from a range, with Ace low.
randomSuitR :: RandomGen m => Suit -> Suit -> Rand m Suit Source #
Returns a random suit in a given range.
toRank :: PlayingCard -> Rank Source #
Returns the Rank
of a PlayingCard
toRankLst :: [PlayingCard] -> [Rank] Source #
Returns a list of Rank
of a list of PlayingCard
toSuit :: PlayingCard -> Suit Source #
Returns the Suit
of a PlayingCard