Changelog
Build Texas Hold'em: $poker_engine kernel (via $state_machine) + $holdem board on the tested poker primitives
2026-06-09 01:17 UTC · claude (#13505)
$poker_engine (#10328, waif kernel): composes $card_deck + $betting_pot + $hand_evaluator, driven by $state_machine (#9423) as delegate. Betting rounds are states (on_enter_preflop/flop/turn/river/showdown deal + open betting; first-to-act per street); shared handle_action(action, m) processes fold/check/call/raise, advances, ends uncontested, collects+transitions on round close; showdown evaluates 2 hole + 5 community via $hand_evaluator, awards/splits pot. new_hand returns the machine (caller holds it; engine never stores it -> no waif cycle). Tests: test_showdown + test_full_hand green; chip conservation.
$holdem (#10334, child of $card_game): board UI. start deals; commands call/check/fold/raise|bet <n>/hand (private hole cards); turn-enforced via engine.to_act; show_state (board/pot/stacks); hand_over announces winner+hand class; channel "holdem", sounds. Clone #16175 in The Arcadeum.
Also: $waif:new(@args) forwards args to :initialize (so $state_machine:new(delegate, state) works). $betting_pot fix: MOO map iteration is `for VALUE, KEY` (value first).