-- import "github.com/ElectricCoffee/cards"
package cards provides basic structures and functions for dealing with playing cards.
func NewDeck(suits, values []string) []Card
NewDeck creates a new deck of cards from a slice of suits and a slice of values.
func NewFifthDimensionDeck() []Card
NewFifthDimensionDeck creates a deck of 5°Dimension Playing Cards. 5°Dimension is unique in that it has five suits, a Princess, a '1' different from Ace, and a Joker for each of the five suits. The five suits are: Spades, Clubs, Hearts, Diamonds, and Stars. The 5°Dimension deck has a total of 80 cards, as opposed to the usual 52.
func NewStandardDeck() []Card
NewStandardDeck creates a new standard western deck of cards with French suits (Spades, Clubs, Hearts, and Diamonds).
func Seed()
Seed seeds the card randomiser using the current time in nanoseconds
func SeedInt(value int64)
SeedInt seeds the card randomiser using an int64 value as its seed.
func Shuffle(deck []Card)
Shuffle randomises the order of the cards in-place. It uses "math/rand" internally, and thus needs to be seeded before use. cards.Seed() and cards.SeedInt(int64) can be used for this
func Shuffled(deck []Card) []Card
Shuffled is like Shuffle, except it's not destructive
type Card struct {
Suit string
Value string
}
Card is a struct holding the suit and value associated with a card.
func NewCard(suit, value string) Card
NewCard creates a new instance of the card struct.