cards

package
v0.0.0-...-3f66cf7 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvgRank

func AvgRank() int

AvgRank returns the average rank across all cards

func MaskForBack

func MaskForBack() *color.Color

func MaskForRank

func MaskForRank(rank int) *color.Color

maskForRank returns the console text mask for the given rank

func Shuffle

func Shuffle(c []int)

Shuffle randomizes the order of the given cards

Types

type Cards

type Cards struct {
	// contains filtered or unexported fields
}

func New

func New() Cards

New returns a shuffled draw pile and a discard pile with one card

func (*Cards) Discard

func (c *Cards) Discard(rank int)

Discard places the given card on top of the discard pile

func (*Cards) Draw

func (c *Cards) Draw() int

Draw returns the top card from the draw pile

func (*Cards) DrawDiscard

func (c *Cards) DrawDiscard() int

DrawDiscard draws the top card from the discard pile

func (Cards) LookDiscard

func (c Cards) LookDiscard() int

LookDiscard returns the rank of the top card in the discard pile

func (Cards) Print

func (c Cards) Print()

func (Cards) PrintDebug

func (c Cards) PrintDebug()

Print prints the given cards in order

Jump to

Keyboard shortcuts

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