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

    Source Files