Expand description
Card primitives, hand evaluation, and game-tree types for Hold’em and Short Deck poker.
Modules§
- tree
- Game-tree types: actions, history, and tree-building helpers.
Macros§
- action
- Constructs a single
AnnotatedActionfrom named-position shorthand. - actions
- Builds a sequence of
AnnotatedActionentries with stacks, blinds, and per-step actions. - board
- Builds a
Boardfrom a string of cards. - c64
- Builds a
Card64bitset from a string of cards. - card
- Parses a string literal into a
Card, panicking on failure. - cards
- Parses a string of cards into a
Vec<Card>. - flop
- Builds a
Flopfrom a string of three cards. - history
- Builds a
Historyfromc(chance) and chip-amount tokens. - isocard
- Parses a single
IsomorphicCardfrom a string, panicking on failure. - isocards
- Parses a sequence of
IsomorphicCards from a string, panicking on failure. - r16
- Builds a
Rank16from a string of rank characters. - s4
- Builds a
Suit4from a string of suit characters.
Structs§
- Card
- Playing card with a rank and suit.
- Card64
- Bitset of cards as a 64-bit mask.
- CardGen
- Random dealer that tracks used and unused cards.
- CardIdx
- Numeric index of a card in the range 0-51.
- Card
Iter - Iterator over cards in a
Card64, ordered by rank then suit. - Hand
Iter - Iterator over every
N-card combination, short-deck whenSDis true. - Hand
Matrix - A poker hand chart: one
Tper distinct preflop hand. - HandN
- Sorted hand of exactly
Ncards. - Hand
Rating - Bit-packed poker hand rating comparable by integer order.
- Isomorphic
Card - A card whose suit is relabeled to a flush-relevant
FlushingSuit. - Isomorphic
HandN - Sorted hand of exactly
Ncards. - Player
- Player identified by a zero-based index.
- Rank16
- Bitset of ranks as a 16-bit mask.
- RankIdx
- Numeric index of a rank in the range 0-12.
- Rank
Iter - Iterator over every
Rankin aRank16. - Suit4
- Bitset of suits as a 4-bit mask.
- SuitIdx
- Numeric index of a suit in the range 0-3.
- SuitMap
- Permutation of the four
Suits used to map a board to its isomorphic form. - Waugh
Indexer - Maps a hand of cards to a dense, suit-isomorphic index using Kevin Waugh’s algorithm.
Enums§
- Board
- Community cards across flop, turn, and river.
- Flop
Hand Category - Category of a hand relative to the flop.
- Flushing
Suit - A suit label relabeled by flush relevance:
X/Y/Zfor candidates,Nfor irrelevant. - Game
- Poker variant.
- Hand
Type - Category of a poker hand, from
HighCardtoStraightFlush. - Hole
Card Rule - How many hole cards a hand must use to form its rating.
- Isomorphic
Board Gto - Canonical suit-isomorphic representative of a board at any street.
- Parse
Error - Parse failure produced by a
FromStrimplementation. - Rank
- Card rank from
R2toRA. - Street
- Betting street of a poker hand.
- Suit
- Card suit (spades, hearts, diamonds, clubs).
Constants§
- MAX_
HOLECARDS - Maximum number of hole cards stored inline.
- MAX_
PLAYERS - Maximum number of players in a game.
Functions§
- calculate_
payoffs - Returns per-player net payoffs after distributing side pots.
- eval_
holdem - Returns the Hold’em rating of 5 to 7 cards.
- eval_
omaha - Returns the Omaha rating of
playeragainstboard. - eval_
omaha5 - Returns the Omaha-5 (5 hole cards, a.k.a. “Big O” / PLO5) rating of
playeragainstboard. - eval_
shortdeck - Returns the Short Deck rating of 5 to 7 cards.
Type Aliases§
- Card
Count - Card count type used throughout the crate.
- Flop
- First three community cards.
- Hand
- A variable-length hand of concrete
Cards. - Idx
- Signed integer representation of a card, rank, or suit.
- Isomorphic
Hand - A variable-length hand of suit-isomorphic
IsomorphicCards. - PerPlayer
- Per-seat values stored inline, bounded by
MAX_PLAYERS. - Player
Idx - Numeric index identifying a player.