Files
pokerfreak/tests/position_fixture/mod.rs
T
mmintelandClaude Opus 5.5 9a9c6c946d Range narrowing from action history, position from inferred button
Wire: optional history decoding. exploit::range_model: role band + postflop
continuations. preflop::button / seat_position: button inference from blinds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 12:41:03 +01:00

46 lines
1.3 KiB
Rust

#![allow(dead_code)]
//! Builders for button-inference tests.
use pokerfreak::card::Card;
use pokerfreak::game::{ActionKind, ActionRecord, SeenAction, Spot, Street, Villain};
use pokerfreak::variant::Variant;
pub fn post_sb(seat: u8) -> ActionRecord {
rec(seat, SeenAction::PostSmallBlind)
}
pub fn post_bb(seat: u8) -> ActionRecord {
rec(seat, SeenAction::PostBigBlind)
}
pub fn rec(seat: u8, action: SeenAction) -> ActionRecord {
ActionRecord { street: Street::Preflop, seat, action, amount: None }
}
/// Preflop NLHE, big blind 1, pot 1.5, 1 to call; no button, no history.
pub fn spot(seats: u8, hero_seat: u8, villain_seats: &[u8], history: Vec<ActionRecord>) -> Spot {
Spot {
variant: Variant::Nlhe,
big_blind: 1.0,
seats,
hero_seat,
button_seat: None,
hero_cards: Card::parse_list("Ah Kh").unwrap(),
board: vec![],
street: Street::Preflop,
pot: 1.5,
to_call: 1.0,
hero_stack: 100.0,
min_raise_to: Some(2.0),
max_raise_to: Some(100.0),
legal: vec![ActionKind::Fold, ActionKind::Call, ActionKind::Raise],
allowed_sizes: None,
villains: villain_seats
.iter()
.map(|s| Villain { seat: *s, stack: 100.0, folded: false, profile: None })
.collect(),
seed: 1,
history,
}
}