Skip to main content

Crate openpql_prelude

Crate openpql_prelude 

Source
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 AnnotatedAction from named-position shorthand.
actions
Builds a sequence of AnnotatedAction entries with stacks, blinds, and per-step actions.
board
Builds a Board from a string of cards.
c64
Builds a Card64 bitset 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 Flop from a string of three cards.
history
Builds a History from c (chance) and chip-amount tokens.
isocard
Parses a single IsomorphicCard from a string, panicking on failure.
isocards
Parses a sequence of IsomorphicCards from a string, panicking on failure.
r16
Builds a Rank16 from a string of rank characters.
s4
Builds a Suit4 from 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.
CardIter
Iterator over cards in a Card64, ordered by rank then suit.
HandIter
Iterator over every N-card combination, short-deck when SD is true.
HandMatrix
A poker hand chart: one T per distinct preflop hand.
HandN
Sorted hand of exactly N cards.
HandRating
Bit-packed poker hand rating comparable by integer order.
IsomorphicCard
A card whose suit is relabeled to a flush-relevant FlushingSuit.
IsomorphicHandN
Sorted hand of exactly N cards.
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.
RankIter
Iterator over every Rank in a Rank16.
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.
WaughIndexer
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.
FlopHandCategory
Category of a hand relative to the flop.
FlushingSuit
A suit label relabeled by flush relevance: X/Y/Z for candidates, N for irrelevant.
Game
Poker variant.
HandType
Category of a poker hand, from HighCard to StraightFlush.
HoleCardRule
How many hole cards a hand must use to form its rating.
IsomorphicBoardGto
Canonical suit-isomorphic representative of a board at any street.
ParseError
Parse failure produced by a FromStr implementation.
Rank
Card rank from R2 to RA.
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 player against board.
eval_omaha5
Returns the Omaha-5 (5 hole cards, a.k.a. “Big O” / PLO5) rating of player against board.
eval_shortdeck
Returns the Short Deck rating of 5 to 7 cards.

Type Aliases§

CardCount
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.
IsomorphicHand
A variable-length hand of suit-isomorphic IsomorphicCards.
PerPlayer
Per-seat values stored inline, bounded by MAX_PLAYERS.
PlayerIdx
Numeric index identifying a player.