Expand description
Poker game engine with state management, action handling, and settlement.
This module implements the rules and mechanics of No-Limit Texas Hold’em, tracking game state across betting rounds and resolving showdowns.
§State Representation
Game— The memoryless present: stacks, pot, board, and active playersPartial— The remembered past: complete action history for a handPath— Compressed action sequence for tree traversal
§Actions
Action— A player decision: fold, check, call, or raiseEdge— A game tree transition with the acting playerOdds— Pot odds abstraction for bet sizing (1/3, 1/2, 2/3, pot, all-in)
§Resolution
Showdown— Final hand comparison when multiple players remainSettlement— Pot distribution with side-pot handlingPnL— Profit and loss accounting per player
§Supporting Types
Seat— Player position and stack at the tableTurn— Whose action it is and what options they haveArrangement— Positional configuration for heads-up or multiwayAbstraction— Abstract bucket assignment for strategic equivalence
§Information Levels
Structs§
- Abstraction
- A discrete bucket representing strategically similar hands.
- Arrangement
- An ordered sequence of up to 7 cards as dealt.
- Game
- The memoryless state of a poker hand.
- Hands
- Iterator over completed hands in a session.
- Odds
- Pot-relative bet sizing as a fraction.
- Partial
- Perfect-recall game history from a single player’s perspective.
- Path
- A compact sequence of abstract edges packed into 64 bits.
- Perfect
- Complete game history with both players’ cards known.
- Perpetual
- Infinite iterator over actions across games.
- PnL
- Public profit/loss information.
- Seat
- A player’s state at the table.
- Session
- Iterator over actions in a session.
- Settlement
- A player’s final result including hand strength.
- Showdown
- Computes chip distributions at showdown.
Enums§
- Action
- A player decision or chance event in the game.
- Edge
- An abstracted game tree transition.
- Position
Name - Named position at a poker table relative to the dealer button.
- Size
- Abstract bet sizing for Edge::Raise.
- State
- Player betting status within a hand.
- Turn
- Whose turn it is to act in the game tree.
Traits§
- Recall
- A game history that can be replayed from a root state.