day7

package
v0.0.0-...-59f084b Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const JokerMarker = "-"
View Source
const JokerPlain = "J"

Variables

This section is empty.

Functions

func HandSortFunc

func HandSortFunc(a, b Hand) (rv int)

HandSortFunc returns a negative number when a < b, a positive number when a > b and zero when a == b.

Types

type Card

type Card int

func NewCard

func NewCard(s string) (c Card, err error)

func (Card) String

func (c Card) String() string

type Hand

type Hand struct {
	Cards []Card
	Bet   int

	WithJoker bool
	// contains filtered or unexported fields
}

func NewHand

func NewHand(s string, withJoker bool) (h Hand, err error)

func (Hand) CardString

func (h Hand) CardString() string

func (Hand) String

func (h Hand) String() string

type HandType

type HandType int
const (
	H_Unknown HandType = iota
	H_High
	H_Pair
	H_2Pair
	H_3Kind
	H_FullHouse
	H_4Kind
	H_5Kind

	H_Max // Must be last!
)

func (HandType) String

func (h HandType) String() string

type Hands

type Hands []Hand

func NewHands

func NewHands(filename string, withJoker bool) (hl Hands, er error)

func (Hands) Winnings

func (h Hands) Winnings() (rv int)

Jump to

Keyboard shortcuts

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