Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Game ¶
type Game struct { Hands Hands // contains filtered or unexported fields }
func NewGame ¶
func NewGame(opts ...GameOption) *Game
func (Game) TotalWinnings ¶
TotalWinnings ranks the hands by type, then calculates the winnings based on the hand's bid and rank.
type GameOption ¶
type GameOption func(*Game)
func WithWildcard ¶
func WithWildcard(card Label) GameOption
type Hand ¶
func (*Hand) ParseLabels ¶
ParseLabels takes a hand as a string, e.g. "K234J" and populates the hand struct.
type HandType ¶
type HandType int
const ( HighCard HandType = iota // HighCard is where all cards' labels are distinct: 23456 OnePair // OnePair is where two cards share one label, and the other three cards have a different label from the pair and each other: A23A4 TwoPair // TwoPair is where two cards share one label, two other cards share a second label, and the remaining card has a third label: 23432 ThreeOfAKind // ThreeOfAKind is where three cards have the same label, and the remaining two cards are each different from any other card in the hand: TTT98 FullHouse // A full house is where three cards have the same label, and the remaining two cards share a different label: 23332 FourOfAKind // FourOfAKind is where four cards have the same label and one card has a different label: AA8AA FiveOfAKind // FiveOfAKind is where all five cards have the same label: AAAAA. )
Click to show internal directories.
Click to hide internal directories.