diff options
| author | Dylan <boss@tehbox.org> | 2026-10-23 19:40:00 +1300 |
|---|---|---|
| committer | Dylan <boss@tehbox.org> | 2026-10-23 19:41:07 +1300 |
| commit | 8b6323efba32da9e3651ce882c02a6e7a6671f23 (patch) | |
| tree | 3b01f4d47176379df2aadbef0ffc621a2d9d6186 /src/main.rs | |
| parent | 50028fc708ef0cfea9fd589c90e07b413ecb570f (diff) | |
| download | tigers-and-sheep-8b6323efba32da9e3651ce882c02a6e7a6671f23.tar.gz tigers-and-sheep-8b6323efba32da9e3651ce882c02a6e7a6671f23.zip | |
feat: Optimisation
Added benchmarking capabilities
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 54fb28f..16467b0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,10 +11,20 @@ mod board_view; mod local_player; #[path = "claude-player.rs"] mod claude_player; +mod bench; fn main() -> std::io::Result<()> { + // `bench [depth]` times the computer player's search without the TUI + let args: Vec<String> = std::env::args().collect(); + if args.get(1).is_some_and(|a| a == "bench") + { + let depth = args.get(2).map_or(6, |d| d.parse().expect("depth should be a number")); + bench::run(depth); + return Ok(()); + } let mut game = GameHandler::default(); - let winner = game.play_game(&mut ClaudePlayer::new(Duration::from_secs(2)), &mut LocalPlayer::default())?; + let winner = game.play_game(&mut ClaudePlayer::new(Duration::from_secs(2)), + &mut ClaudePlayer::new(Duration::from_secs(2)))?; if let Some(winner) = winner { println!("{winner:?} wins!"); |
