playing_cards

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 3 Imported by: 3

README

Playing Cards

Types for the Reduced French Tarot playing card deck.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	Suit Suit
	Rank Rank
	Name string
}

func (Card) LaTeX added in v0.1.1

func (c Card) LaTeX() []byte

type Deck

type Deck []Card

func CombineDecks added in v0.2.0

func CombineDecks(decks ...*Deck) *Deck

func NewDeck

func NewDeck() *Deck

func NewDeckFromCards added in v0.2.0

func NewDeckFromCards(cards ...Card) *Deck

func (*Deck) Append added in v0.2.0

func (d *Deck) Append(c *Deck)

func (*Deck) Cut added in v0.2.0

func (d *Deck) Cut(idx int) ([]*Deck, error)

func (*Deck) DealFromBottom added in v0.2.0

func (d *Deck) DealFromBottom(count int) ([]Card, error)

func (*Deck) DealFromTop added in v0.2.0

func (d *Deck) DealFromTop(count int) ([]Card, error)

func (*Deck) Len added in v0.2.0

func (d *Deck) Len() int

func (*Deck) Shuffle added in v0.2.0

func (d *Deck) Shuffle()

type Rank

type Rank int
const (
	Joker Rank = iota
	Ace
	Duce
	Three
	Four
	Five
	Six
	Seven
	Eight
	Nine
	Ten
	Jack
	Knight
	Queen
	King
)

func (Rank) LaTeX

func (r Rank) LaTeX() []byte

func (Rank) String

func (r Rank) String() string

type Suit

type Suit int
const (
	Suitless Suit = iota
	Hearts
	Clubs
	Diamonds
	Spades
	Red
	Black
	Wands
	Cups
	Swords
	Pentacles
	MajorArcana
)

func (Suit) LaTeX

func (s Suit) LaTeX() []byte

LaTeX returns the LaTeX command that will print the symbol for this card's suit. For the standard deck of playing cards, the commands should work fine in base LaTeX. For the Tarot suits, however, the following packages will need to be included:

  • esrelation
  • fourier
  • linearb
  • MnSymbol

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL