general-games-1.1.1: Library supporting simulation of a number of games

Copyright(c) 2017 Christopher A. Gorski
LicenseMIT
MaintainerChristopher A. Gorski <cgorski@cgorski.org>
Safe HaskellSafe
LanguageHaskell2010

Game.Implement.Card.Standard

Description

The Game.Game.Poker module defines structures and operations for a standard set of 52 playing cards.

Synopsis

Documentation

data PlayingCard Source #

A representation of a standard playing card, distinguishable by rank and suit.

Constructors

PlayingCard Rank Suit 

Instances

Bounded PlayingCard Source # 
Enum PlayingCard Source # 
Eq PlayingCard Source # 
Ord PlayingCard Source # 
Read PlayingCard Source # 
Show PlayingCard Source # 
Card PlayingCard Source # 
OrderedCard PlayingCard Order Source # 
ValuedCard PlayingCard Suit Source # 
ValuedCard PlayingCard Rank Source # 
OrderedValuedCard PlayingCard Order ValueType Source # 

data Rank Source #

The rank of a standard playing card.

Constructors

Ace 
Two 
Three 
Four 
Five 
Six 
Seven 
Eight 
Nine 
Ten 
Jack 
Queen 
King 

data Suit Source #

The suit of a standard playing card.

Constructors

Clubs 
Diamonds 
Hearts 
Spades 

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.

randomSuit :: RandomGen m => Rand m Suit Source #

Returns a random Suit.

randomSuitR :: RandomGen m => Suit -> Suit -> Rand m Suit Source #

Returns a random suit in a given range.

ranks :: [Rank] Source #

Returns all standard playing card ranks, with Ace low.

nRanks :: Int Source #

Returns the number of unique standard playing card ranksu.

toRankLst :: [PlayingCard] -> [Rank] Source #

Returns a list of Rank of a list of PlayingCard

suits :: [Suit] Source #

Returns all standard card suits.

nSuits :: Int Source #

Returns the number of all standard card unique suits.

uniqueNumList :: RandomGen g => Int -> Int -> Int -> Rand g (Maybe [Int]) Source #

Return a list of unique numbers, of length s, drawn without replacement from the set [n..m]

uniqueNumLists :: RandomGen g => [Int] -> Int -> Int -> Rand g (Maybe [[Int]]) Source #

Return lists of lists of unique numbers, of length [s], drawn without replacement from the set [n..m]