package
module
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Sep 30, 2025
License: BSD-3-Clause
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 3
Opens a new window with list of known importers.
README
¶
Documentation
¶
View Source
var Ranks = []Rank{Ace, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King}
type Card struct {
Suit Suit
Rank Rank
}
Card represents a playing card with a suit and rank.
String returns the string representation of the Card.
type CardSet interface {
Shuffle()
String() string
Draw() Card
}
CardSet represents a set of cards that can be shuffled.
Deck represents a standard 52 card deck.
NewDeck creates and returns a new standard 52 card deck.
Draw removes and returns the top card from the deck.
Shuffle shuffles the deck of cards in place.
String returns the string representation of the Deck.
Rank represents one of 13 standard card ranks.
const (
Ace Rank
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten
Jack
Queen
King
)
String returns the string representation of the Rank.
Shoe represents a collection of multiple decks of cards.
NewShoe creates and returns a new shoe containing the specified number of decks.
Draw removes and returns the top card from the shoe.
Shuffle shuffles the shoe of cards in place.
String returns the string representation of the Shoe.
Suit represents the french suit of a standard 52 card deck.
const (
Diamonds Suit
Clubs
Hearts
Spades
)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.