playing

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT, Unlicense Imports: 0 Imported by: 0

Documentation

Overview

Package playing provides types for modeling a deck of conventional playing cards.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	Suit
	Rank
}

func Deck

func Deck() []Card

type Color

type Color bool
const (
	Red   Color = true
	Black Color = false
)

type Rank

type Rank uint8
const (
	Ace Rank = iota
	Two
	Three
	Four
	Five
	Six
	Seven
	Eight
	Nine
	Ten
	Jack
	Queen
	King
	UnknownRank
)

func (Rank) String

func (r Rank) String() string

type Suit

type Suit uint8
const (
	Spades Suit = iota
	Clubs
	Hearts
	Diamonds
	UnknownSuit
)

func (Suit) Color

func (s Suit) Color() Color

func (Suit) String

func (s Suit) String() string

Jump to

Keyboard shortcuts

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