Versions in this module Expand all Collapse all v0 v0.13.0 Aug 9, 2024 v0.12.0 Aug 9, 2024 v0.1.0 Aug 9, 2024 Changes in this version + const DeckFrench + const DeckKuhn + const DeckLeduc + const DeckManila + const DeckRoyal + const DeckShort + const DeckSpanish + const InvalidCard + const InvalidRank + const InvalidSuit + const UnicodeClubAce + const UnicodeClubBlack + const UnicodeClubWhite + const UnicodeDiamondAce + const UnicodeDiamondBlack + const UnicodeDiamondWhite + const UnicodeHeartAce + const UnicodeHeartBlack + const UnicodeHeartWhite + const UnicodeSpadeAce + const UnicodeSpadeBlack + const UnicodeSpadeWhite + var AlternateEmoji = [4]string + func CactusDesc(f fmt.State, verb rune, rank EvalRank, best, unused []Card) + func FlushOverDesc(f fmt.State, verb rune, rank EvalRank, best, unused []Card) + func HashKey(c0, c1 Card) string + func HighDesc(f fmt.State, verb rune, rank EvalRank, best, unused []Card) + func HoldemBlinds() []string + func HoldemStarting() map[string]ExpValue + func Init() + func LowDesc(f fmt.State, verb rune, rank EvalRank, best, unused []Card) + func LowballDesc(f fmt.State, verb rune, rank EvalRank, best, unused []Card) + func Order(evs []*Eval, low bool) ([]int, int) + func RazzDesc(f fmt.State, verb rune, rank EvalRank, best, unused []Card) + func RegisterDefaultTypes() error + func RegisterType(desc TypeDesc) error + func SokoDesc(f fmt.State, verb rune, rank EvalRank, best, unused []Card) + func StudBlinds() []string + func ThreeDesc(f fmt.State, verb rune, rank EvalRank, best, unused []Card) + type BinGen struct + func NewBinGenInit[T any](s []T, k int, unused bool, d []T) *BinGen[T] + func NewBinGen[T any](s []T, k int) *BinGen[T] + func NewCombinGen[T any](s []T, k int) (*BinGen[T], []T) + func NewCombinUnusedGen[T any](s []T, k int) (*BinGen[T], []T) + func (g *BinGen[T]) Copy() + func (g *BinGen[T]) Next() bool + func (g *BinGen[T]) Unused() + type CalcOption func(interface{}) + func WithActive(active map[int]bool, folded bool) CalcOption + func WithBoard(board []Card) CalcOption + func WithDeep(deep bool) CalcOption + func WithDiscard(discard bool) CalcOption + func WithOpponents(opponents int) CalcOption + func WithPocketsBoard(pockets [][]Card, board []Card) CalcOption + func WithRuns(runs []*Run) CalcOption + type Card uint32 + func Exclude(v []Card, ex ...[]Card) []Card + func FromIndex(i int) Card + func FromRune(r rune) Card + func FromString(s string) Card + func Must(v ...string) []Card + func New(rank Rank, suit Suit) Card + func Parse(v ...string) ([]Card, error) + func (c *Card) UnmarshalText(buf []byte) error + func (c Card) AceRank() int + func (c Card) Format(f fmt.State, verb rune) + func (c Card) Index() int + func (c Card) KnightRune() rune + func (c Card) MarshalText() ([]byte, error) + func (c Card) Rank() Rank + func (c Card) RankByte() byte + func (c Card) RankIndex() int + func (c Card) Rune() rune + func (c Card) String() string + func (c Card) Suit() Suit + func (c Card) SuitByte() byte + func (c Card) SuitIndex() int + type Dealer struct + Active map[int]bool + Count int + Deck *Deck + Results []*Result + Runs []*Run + func NewDealer(desc TypeDesc, deck *Deck, count int) *Dealer + func NewShuffledDealer(desc TypeDesc, shuffler Shuffler, shuffles, count int) *Dealer + func (d *Dealer) Board() int + func (d *Dealer) BoardDiscard() int + func (d *Dealer) Calc(ctx context.Context, folded bool, opts ...CalcOption) (*Odds, *Odds, bool) + func (d *Dealer) ChangeRuns(runs int) bool + func (d *Dealer) Deactivate(positions ...int) bool + func (d *Dealer) Deal(street int, run *Run) + func (d *Dealer) Discarded() []Card + func (d *Dealer) Format(f fmt.State, verb rune) + func (d *Dealer) HasActive() bool + func (d *Dealer) HasBoard() bool + func (d *Dealer) HasCalc() bool + func (d *Dealer) HasNext() bool + func (d *Dealer) HasPocket() bool + func (d *Dealer) Id() byte + func (d *Dealer) Inactive() []int + func (d *Dealer) Name() string + func (d *Dealer) Next() bool + func (d *Dealer) NextId() byte + func (d *Dealer) NextResult() bool + func (d *Dealer) Pocket() int + func (d *Dealer) PocketDiscard() int + func (d *Dealer) PocketDraw() int + func (d *Dealer) PocketUp() int + func (d *Dealer) Reset() + func (d *Dealer) Result() (int, *Result) + func (d *Dealer) Run() (int, *Run) + func (d *Dealer) Street() int + type Deck struct + func DeckOf(cards ...Card) *Deck + func NewDeck() *Deck + func NewShoe(count int) *Deck + func (d *Deck) All() []Card + func (d *Deck) Draw(count int) []Card + func (d *Deck) Empty() bool + func (d *Deck) Limit(limit int) + func (d *Deck) Remaining() int + func (d *Deck) Reset() + func (d *Deck) Shuffle(shuffler Shuffler, shuffles int) + type DeckType uint8 + func (typ DeckType) Desc(short bool) string + func (typ DeckType) Exclude(ex ...[]Card) []Card + func (typ DeckType) Format(f fmt.State, verb rune) + func (typ DeckType) Name() string + func (typ DeckType) New() *Deck + func (typ DeckType) Ordinal() int + func (typ DeckType) Shoe(count int) *Deck + func (typ DeckType) Shuffle(shuffler Shuffler, shuffles int) *Deck + func (typ DeckType) Unshuffled() []Card + type DescType uint8 + const DescCactus + const DescFlushOver + const DescHigh + const DescLow + const DescLowball + const DescRazz + const DescSoko + const DescThree + func (typ DescType) Byte() byte + func (typ DescType) Desc(f fmt.State, verb rune, rank EvalRank, best, unused []Card) + func (typ DescType) Format(f fmt.State, verb rune) + func (typ DescType) Name() string + type Error string + const ErrInvalidCard + const ErrInvalidId + const ErrInvalidType + const ErrMismatchedIdAndType + func (err Error) Error() string + type Eval struct + HiBest []Card + HiRank EvalRank + HiUnused []Card + LoBest []Card + LoRank EvalRank + LoUnused []Card + Type Type + func EvalOf(typ Type) *Eval + func (ev *Eval) Comp(b *Eval, low bool) int + func (ev *Eval) Desc(low bool) *EvalDesc + func (ev *Eval) Eval(pocket, board []Card) + func (ev *Eval) Format(f fmt.State, verb rune) + func (ev *Eval) Hi5(f RankFunc, v []Card) + func (ev *Eval) Hi6(f RankFunc, v []Card) + func (ev *Eval) Hi7(f RankFunc, v []Card) + func (ev *Eval) HiLo23(hi, lo RankFunc, c0, c1 Card, b []Card, max EvalRank) + func (ev *Eval) HiLo24(hi, lo RankFunc, c0, c1 Card, b []Card, max EvalRank) + func (ev *Eval) HiLo25(hi, lo RankFunc, c0, c1 Card, b []Card, max EvalRank) + func (ev *Eval) HiLo5(hi, lo RankFunc, v []Card, max EvalRank) + func (ev *Eval) HiLo6(hi, lo RankFunc, v []Card, max EvalRank) + func (ev *Eval) HiLo7(hi, lo RankFunc, v []Card, max EvalRank) + func (ev *Eval) Max5(f RankFunc, v []Card, max EvalRank, low bool) + func (ev *Eval) Max6(f RankFunc, v []Card, max EvalRank, low bool) + func (ev *Eval) Max7(f RankFunc, v []Card, max EvalRank, low bool) + type EvalDesc struct + Best []Card + Rank EvalRank + Type DescType + Unused []Card + func (desc *EvalDesc) Format(f fmt.State, verb rune) + type EvalFunc func(*Eval, []Card, []Card) + func NewBadugiEval(normalize bool) EvalFunc + func NewCactusEval(normalize, low bool) EvalFunc + func NewEval(f RankFunc) EvalFunc + func NewHighEval() EvalFunc + func NewHybridEval(normalize, low bool) EvalFunc + func NewJacksOrBetterEval(normalize bool) EvalFunc + func NewLeducEval() EvalFunc + func NewLowballEval(normalize bool) EvalFunc + func NewMaxEval(f RankFunc, max EvalRank, low bool) EvalFunc + func NewModifiedEval(hi RankFunc, base Rank, inv func(EvalRank) EvalRank, normalize, low bool) EvalFunc + func NewOmahaEval(hi RankFunc, base Rank, inv func(EvalRank) EvalRank, normalize, low bool) EvalFunc + func NewRazzEval(normalize bool) EvalFunc + func NewSokoEval(normalize, low bool) EvalFunc + func NewSplitEval(hi, lo RankFunc, max EvalRank) EvalFunc + func NewThreeEval() EvalFunc + type EvalRank uint16 + const Flush + const FourOfAKind + const FullHouse + const HighCard + const Invalid + const Nothing + const Pair + const Straight + const StraightFlush + const ThreeOfAKind + const TwoPair + func Cactus(c0, c1, c2, c3, c4 Card) EvalRank + func CactusFast(c0, c1, c2, c3, c4 Card) EvalRank + func RankAceFiveLow(mask EvalRank, c0, c1, c2, c3, c4 Card) EvalRank + func RankEightOrBetter(c0, c1, c2, c3, c4 Card) EvalRank + func RankLowball(c0, c1, c2, c3, c4 Card) EvalRank + func RankManila(c0, c1, c2, c3, c4 Card) EvalRank + func RankRazz(c0, c1, c2, c3, c4 Card) EvalRank + func RankShort(c0, c1, c2, c3, c4 Card) EvalRank + func RankSoko(c0, c1, c2, c3, c4 Card) EvalRank + func RankSpanish(c0, c1, c2, c3, c4 Card) EvalRank + func (r EvalRank) Fixed() EvalRank + func (r EvalRank) Format(f fmt.State, verb rune) + func (r EvalRank) FromFlushOver() EvalRank + func (r EvalRank) FromLowball() EvalRank + func (r EvalRank) Name() string + func (r EvalRank) Title() string + func (r EvalRank) ToFlushOver() EvalRank + func (r EvalRank) ToLowball() EvalRank + type EvalType uint8 + const EvalBadugi + const EvalCactus + const EvalHigh + const EvalJacksOrBetter + const EvalLowball + const EvalManila + const EvalOmaha + const EvalRazz + const EvalShort + const EvalSoko + const EvalSpanish + const EvalThree + func (typ EvalType) Byte() byte + func (typ EvalType) Cactus() bool + func (typ EvalType) Format(f fmt.State, verb rune) + func (typ EvalType) Name() string + func (typ EvalType) New(normalize, low bool) EvalFunc + type ExpValue struct + Losses uint64 + Opponents int + Splits uint64 + Total uint64 + Wins uint64 + func NewExpValue(opponents int) *ExpValue + func StartingExpValue(pocket []Card) *ExpValue + func (expv *ExpValue) Add(v *ExpValue) + func (expv *ExpValue) Float64() float64 + func (expv *ExpValue) Format(f fmt.State, verb rune) + func (expv *ExpValue) Percent() float64 + type ExpValueCalc struct + func NewExpValueCalc(typ Type, pocket []Card, opts ...CalcOption) *ExpValueCalc + func (c *ExpValueCalc) Calc(ctx context.Context) (*ExpValue, bool) + func (c *ExpValueCalc) NewExpValue() *ExpValue + type Formatter []Card + func (v Formatter) Format(f fmt.State, verb rune) + type Odds struct + Counts []int + Outs []map[Card]bool + Total int + func NewOdds(count int, u []Card) *Odds + func (odds *Odds) Add(evs []*Eval, suits [][4]int, v []Card, low bool) + func (odds *Odds) Float32() []float32 + func (odds *Odds) Format(f fmt.State, verb rune) + func (odds *Odds) Percent(pos int) float32 + type OddsCalc struct + func NewOddsCalc(typ Type, opts ...CalcOption) *OddsCalc + func (c *OddsCalc) Calc(ctx context.Context) (*Odds, *Odds, bool) + type ParseError struct + Err error + I int + N int + S string + func (err *ParseError) Error() string + func (err *ParseError) Unwrap() error + type Rank uint8 + const Ace + const Eight + const Five + const Four + const Jack + const King + const Nine + const Queen + const Seven + const Six + const Ten + const Three + const Two + func RankFromRune(r rune) Rank + func (rank Rank) Byte() byte + func (rank Rank) Index() int + func (rank Rank) Name() string + func (rank Rank) PluralName() string + func (rank Rank) StraightFlushName() string + func (rank Rank) String() string + type RankFunc func(c0, c1, c2, c3, c4 Card) EvalRank + var RankCactus RankFunc + type Result struct + Evals []*Eval + HiOrder []int + HiPivot int + LoOrder []int + LoPivot int + func NewResult(typ Type, run *Run, active map[int]bool, calc bool) *Result + func (res *Result) Win(names ...string) (*Win, *Win) + type Run struct + Discard []Card + Hi []Card + Lo []Card + Pockets [][]Card + func NewRun(count int) *Run + func (run *Run) CalcStart(low bool) (*Odds, *Odds) + func (run *Run) Dupe() *Run + func (run *Run) Eval(typ Type, active map[int]bool, calc bool) []*Eval + type Shuffler interface + Shuffle func(int, func(int, int)) + type StreetDesc struct + Board int + BoardDiscard int + Id byte + Name string + Pocket int + PocketDiscard int + PocketDraw int + PocketUp int + func HoldemStreets(pocket, discard, flop, turn, river int) []StreetDesc + func NumberedStreets(pockets ...int) []StreetDesc + func StudStreets() []StreetDesc + func (desc StreetDesc) Desc() string + type StreetOption func(int, *StreetDesc) + type Suit uint8 + const Club + const Diamond + const Heart + const Spade + func SuitFromRune(r rune) Suit + func (suit Suit) AlternateEmoji() string + func (suit Suit) Byte() byte + func (suit Suit) Emoji() string + func (suit Suit) Index() int + func (suit Suit) Name() string + func (suit Suit) PluralName() string + func (suit Suit) String() string + func (suit Suit) UnicodeBlack() rune + func (suit Suit) UnicodeWhite() rune + type Type uint16 + const Badugi + const Courchevel + const CourchevelHiLo + const Dallas + const Double + const Draw + const DrawHiLo + const Fusion + const FusionHiLo + const Holdem + const Houston + const Kuhn + const Leduc + const Lowball + const LowballTriple + const Manila + const Omaha + const OmahaDouble + const OmahaFive + const OmahaHiLo + const OmahaRoyal + const OmahaSix + const Razz + const RhodeIsland + const River + const Royal + const Short + const Showtime + const Soko + const SokoHiLo + const Spanish + const Split + const Stud + const StudFive + const StudHiLo + const Swap + const Video + func IdToType(id string) (Type, error) + func Types() []Type + func (typ *Type) UnmarshalText(buf []byte) error + func (typ Type) Blinds() []string + func (typ Type) Board() int + func (typ Type) BoardDiscard() int + func (typ Type) Cactus() bool + func (typ Type) Deal(shuffler Shuffler, shuffles, count int) ([][]Card, []Card) + func (typ Type) Dealer(shuffler Shuffler, shuffles, count int) *Dealer + func (typ Type) Deck() *Deck + func (typ Type) DeckType() DeckType + func (typ Type) Desc() TypeDesc + func (typ Type) Double() bool + func (typ Type) Draw() bool + func (typ Type) Eval(pocket, board []Card) *Eval + func (typ Type) EvalPockets(pockets [][]Card, board []Card) []*Eval + func (typ Type) ExpValue(ctx context.Context, pocket []Card, opts ...CalcOption) (*ExpValue, bool) + func (typ Type) Format(f fmt.State, verb rune) + func (typ Type) Id() string + func (typ Type) Low() bool + func (typ Type) MarshalText() ([]byte, error) + func (typ Type) Max() int + func (typ Type) Name() string + func (typ Type) Odds(ctx context.Context, pockets [][]Card, board []Card, opts ...CalcOption) (*Odds, *Odds, bool) + func (typ Type) Once() bool + func (typ Type) Pocket() int + func (typ Type) PocketDiscard() int + func (typ Type) Show() bool + func (typ Type) Streets() []StreetDesc + type TypeDesc struct + Blinds []string + Deck DeckType + Double bool + Eval EvalType + HiDesc DescType + LoDesc DescType + Low bool + Max int + Name string + Num int + Once bool + Show bool + Streets []StreetDesc + Type Type + func DefaultTypes() []TypeDesc + func NewType(id string, typ Type, name string, opts ...TypeOption) (*TypeDesc, error) + func (desc *TypeDesc) Apply(opts ...StreetOption) + type TypeOption func(*TypeDesc) + func WithBadugi(opts ...StreetOption) TypeOption + func WithCourchevel(low bool, opts ...StreetOption) TypeOption + func WithDallas(low bool, opts ...StreetOption) TypeOption + func WithDouble(opts ...StreetOption) TypeOption + func WithDraw(low bool, opts ...StreetOption) TypeOption + func WithFusion(low bool, opts ...StreetOption) TypeOption + func WithHoldem(low bool, opts ...StreetOption) TypeOption + func WithHouston(low bool, opts ...StreetOption) TypeOption + func WithKuhn(opts ...StreetOption) TypeOption + func WithLeduc(opts ...StreetOption) TypeOption + func WithLowball(multi bool, opts ...StreetOption) TypeOption + func WithManila(opts ...StreetOption) TypeOption + func WithOmaha(low bool, opts ...StreetOption) TypeOption + func WithOmahaDouble(opts ...StreetOption) TypeOption + func WithOmahaFive(low bool, opts ...StreetOption) TypeOption + func WithOmahaRoyal(opts ...StreetOption) TypeOption + func WithOmahaSix(low bool, opts ...StreetOption) TypeOption + func WithRazz(opts ...StreetOption) TypeOption + func WithRhodeIsland(opts ...StreetOption) TypeOption + func WithRiver(low bool, opts ...StreetOption) TypeOption + func WithRoyal(opts ...StreetOption) TypeOption + func WithShort(opts ...StreetOption) TypeOption + func WithShowtime(low bool, opts ...StreetOption) TypeOption + func WithSoko(low bool, opts ...StreetOption) TypeOption + func WithSpanish(opts ...StreetOption) TypeOption + func WithStud(low bool, opts ...StreetOption) TypeOption + func WithStudFive(low bool, opts ...StreetOption) TypeOption + func WithSwap(low bool, opts ...StreetOption) TypeOption + func WithVideo(low bool, opts ...StreetOption) TypeOption + type Win struct + Evals []*Eval + Low bool + Names []string + Order []int + Pivot int + Scoop bool + func NewWin(evs []*Eval, order []int, pivot int, low, scoop bool, names []string) *Win + func (win *Win) Desc() []*EvalDesc + func (win *Win) Format(f fmt.State, verb rune) + func (win *Win) Invalid() bool + func (win *Win) Verb() string