Documentation
¶
Overview ¶
Package cards provides methods for common operations on a deck of cards
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Ranks = 13
The number of ranks (values) per suit. By default this is 13
View Source
var Suits = []rune{'♠', '♡', '♢', '♣'}
The possible suits to use. By default this is {'♠', '♡', '♢', '♣'}
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card int
Card represents a Card in a Deck
type Deck ¶
type Deck []Card
Deck represents a deck of cards
func NewDeck ¶
func NewDeck() Deck
NewDeck returns a new deck of cards, in order
One card will be included of each suit and rank, for a total of Ranks*len(Suits) cards
func Riffle ¶
Combines two decks using a strictly mechanical riffle, alternating a card from each deck
func (*Deck) Sort ¶
func (dp *Deck) Sort()
Sort sorts the deck into the same order it was in when it was created
Click to show internal directories.
Click to hide internal directories.