use chironaut::Game;
use chironaut::rules::{GameRules, AnteStructure};
fn main() {
println!("Testing Different Ante Structures\n");
println!("=== TEST 1: FIXED ANTE ===");
test_ante_structure(GameRules::nlhe(5, 10).with_ante(2));
println!("\n=== TEST 2: BIG BLIND ANTE ===");
test_ante_structure(GameRules::nlhe(5, 10).with_bb_ante(20));
println!("\n=== TEST 3: BUTTON ANTE ===");
test_ante_structure(GameRules::nlhe(5, 10).with_button_ante(15));
println!("\n=== TEST 4: PERCENTAGE ANTE (20% of BB) ===");
test_ante_structure(GameRules::nlhe(5, 10).with_percentage_ante(20));
println!("\n=== TEST 5: NO ANTE ===");
test_ante_structure(GameRules::nlhe(5, 10));
}
fn test_ante_structure(rules: GameRules) {
println!("Game Rules: {}/{} {}",
rules.small_blind,
rules.big_blind,
rules.ante_structure);
let ante_amount = rules.calculate_ante_amount();
println!("Calculated ante amount: {}", ante_amount);
let mut game = Game::new(rules);
for i in 0..5 {
game.add_player(format!("Player {}", i+1), 100).unwrap();
}
game.start_hand().unwrap();
println!("\nPlayer chip counts after blinds and antes:");
let mut total_pot = 0;
for (i, player) in game.players.iter().enumerate() {
println!("Player {}: {} chips (bet: {})",
i+1, player.chips, player.bet_amount);
total_pot += player.bet_amount;
}
println!("\nPot size: {}", game.pot);
println!("Sum of player bets: {}", total_pot);
if game.pot != total_pot {
println!("ERROR: Pot size doesn't match sum of bets!");
} else {
println!("Pot size matches sum of bets ✓");
}
println!("\nPositions:");
println!("Dealer: Player {}", game.dealer_position + 1);
println!("First to act: Player {}", game.current_position + 1);
println!("Current bet: {}", game.current_bet);
}