Files
pokerfreak/tests/short_deck_spot/mod.rs
T
mmintel 04d5251acf Welt ohne fremden Namen: Pruefordner vollstaendig mitkopieren, Engine nur im eigenen Baum
Die Welt nannte 'pokerfreak' nur noch in zwei Harness-Zeilen - der Rest waren veraltete
Rust-Pruefungen im Pruefordner, die der Aufbau nie auffrischte.
2026-11-01 23:37:11 +01:00

46 lines
1.3 KiB
Rust

#![allow(dead_code)]
//! Short deck spots: the NLHE fixture with cards that exist in a 36-card deck.
use rechner::card::Card;
use rechner::game::{Spot, Street, Villain};
use rechner::variant::Variant;
pub fn cards(text: &str) -> Vec<Card> {
Card::parse_list(text).expect("fixture cards")
}
pub fn villain(seat: u8, folded: bool) -> Villain {
Villain { seat, stack: 10.0, folded, profile: None }
}
/// SHORT_DECK flop, hero Ah9h on Ac7d6s: same chips as the NLHE fixture
/// (pot 1.25, 0.2 to call, stack 2.4, raise bounds 0.5..= 20).
pub fn flop() -> Spot {
use rechner::game::ActionKind::{Call, Fold, Raise};
Spot {
variant: Variant::ShortDeck,
big_blind: 0.1,
seats: 6,
hero_seat: 5,
button_seat: None,
hero_cards: cards("Ah 9h"),
board: cards("Ac 7d 6s"),
street: Street::Flop,
pot: 1.25,
to_call: 0.2,
hero_stack: 2.4,
min_raise_to: Some(0.5),
max_raise_to: Some(20.0),
legal: vec![Fold, Call, Raise],
allowed_sizes: None,
villains: vec![villain(2, false)],
seed: 1,
history: Vec::new(),
}
}
/// The same spot played as NLHE (cards stay legal in both decks).
pub fn as_nlhe(spot: Spot) -> Spot {
Spot { variant: Variant::Nlhe, ..spot }
}