poker

package
v0.0.0-...-483a45e Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2014 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardStrength

type CardStrength uint8
const (
	AceLow  CardStrength = CardStrength(Ace)
	AceHigh CardStrength = CardStrength(King + 1)
)

func MaxCardStrength

func MaxCardStrength(strengths []CardStrength) CardStrength

func (CardStrength) Mask

func (cs CardStrength) Mask() uint16

func (CardStrength) Rank

func (cs CardStrength) Rank() Rank

type Game

type Game struct {
	Name       string
	HandSize   int
	BoardSize  int
	HiStrength GameStrengthFunc
	LoStrength GameStrengthFunc
}

func GetGame

func GetGame(gt GameType) Game

func (Game) HasHiHand

func (g Game) HasHiHand() bool

func (Game) HasLoHand

func (g Game) HasLoHand() bool

func (Game) IsHiLo

func (g Game) IsHiLo() bool

type GameStrengthFunc

type GameStrengthFunc func(board, hand []Card) HandStrength

type GameType

type GameType string
const (
	Holdem    GameType = "holdem"
	Omaha     GameType = "omaha"
	OmahaHiLo GameType = "omahahl"
	Stud7     GameType = "stud7"
	Stud7HiLo GameType = "stud7hl"
	Stud5     GameType = "stud5"
	Razz      GameType = "razz"
)

type HandRank

type HandRank uint8
const (
	NoHand HandRank = iota
	HighCard
	Pair
	TwoPair
	Trips
	Straight
	Flush
	FullHouse
	Quads
	StraightFlush
)

func HandRanks

func HandRanks() []HandRank

func (HandRank) String

func (hr HandRank) String() string

type HandStrength

type HandStrength uint32

func GetHandStrength

func GetHandStrength(hand []Card) HandStrength

func GetHoldemHandStrength

func GetHoldemHandStrength(board, pocket []Card) HandStrength

func GetLowHandStrength

func GetLowHandStrength(hand []Card, eightOrBetter bool) HandStrength

func GetOmahaHandStrength

func GetOmahaHandStrength(board, pocket []Card) HandStrength

func GetOmahaLowHandStrength

func GetOmahaLowHandStrength(board, pocket []Card) HandStrength

func MakeHandStrength

func MakeHandStrength(rank HandRank, strength1, strength2 CardStrength, kickers uint16) HandStrength

func MaxHandStrength

func MaxHandStrength(strengths []HandStrength) HandStrength

func MinHandStrength

func MinHandStrength(strengths []HandStrength) HandStrength

func (HandStrength) Rank

func (hs HandStrength) Rank() HandRank

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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