46 lines
1.3 KiB
Rust
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 pokerfreak::card::Card;
|
|
use pokerfreak::game::{Spot, Street, Villain};
|
|
use pokerfreak::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 pokerfreak::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 }
|
|
}
|