Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidCode = errors.New("invalid code")
ErrInvalidCode is returned when a code is invalid.
View Source
var ErrInvalidRank = errors.New("invalid rank")
ErrInvalidRank is returned when a rank is invalid.
View Source
var ErrInvalidSuit = errors.New("invalid suit")
ErrInvalidSuit is returned when a suit is invalid.
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card struct {
// contains filtered or unexported fields
}
Card represents a card in a deck.
type Code ¶
type Code struct {
// contains filtered or unexported fields
}
Code represents a card code.
func CodeFromRankSuit ¶ added in v0.2.0
CodeFromRankSuit returns a new code given a rank and suit.
func CodeFromString ¶ added in v0.2.0
CodeFromString returns a new card code given a string. The string must be 2 characters long. The first character must be a valid rank. The second character must be a valid suit.
func CodesFromStrings ¶ added in v0.2.0
CodesFromStrings returns a collection of codes given a collection of string.
type Rank ¶
type Rank struct {
// contains filtered or unexported fields
}
Rank represents the rank of a card.
type Ranks ¶
type Ranks []Rank
Ranks is a collection of Rank.
func (Ranks) RankFromCode ¶
RankFromCode returns the rank from the given code.
Click to show internal directories.
Click to hide internal directories.