diff options
| author | Dylan <boss@tehbox.org> | 2026-10-22 17:17:02 +1300 |
|---|---|---|
| committer | Dylan <boss@tehbox.org> | 2026-10-22 17:17:02 +1300 |
| commit | 7dff6572462bdc59011f8ff8d1c6dc3a0494e44a (patch) | |
| tree | 0e9e9bd39e9ee68fd5fd0c94afffb8204c637fc2 /src/claude-player.rs | |
| parent | 15bdaa5d550115d97be3f89126c924b49c10a70f (diff) | |
| download | tigers-and-sheep-7dff6572462bdc59011f8ff8d1c6dc3a0494e44a.tar.gz tigers-and-sheep-7dff6572462bdc59011f8ff8d1c6dc3a0494e44a.zip | |
feat: Improvements to UI
Now uses ratatui
Diffstat (limited to 'src/claude-player.rs')
| -rw-r--r-- | src/claude-player.rs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/claude-player.rs b/src/claude-player.rs index 4590c12..0a54ab5 100644 --- a/src/claude-player.rs +++ b/src/claude-player.rs @@ -1,6 +1,6 @@ use std::{collections::HashMap, time::Duration}; -use crate::{board::{GameBoard, Move, PieceType, Turn}, player::{CacheEntry, MinimaxPlayer}}; +use crate::{board::{is_jump, GameBoard, Move, PieceType, Turn}, player::{CacheEntry, MinimaxPlayer}}; /// Sheep that start the game: on the board plus in hand. const TOTAL_SHEEP: u32 = 20; @@ -61,19 +61,11 @@ impl MinimaxPlayer for ClaudePlayer + 2.0 * tiger_moves.len() as f32 } + fn name(&self) -> String { "Claude".to_string() } + fn time_limit(&self) -> Duration { self.time_limit } fn cache(&mut self) -> Option<&mut dyn crate::player::ScoreCache> { Some(&mut self.cache) } } - -/// True for a tiger move of two points, which always jumps (and kills) a sheep. -fn is_jump(mv: Move) -> bool -{ - match mv - { - Move::MoveTiger { from: (fx, fy), to: (tx, ty) } => fx.abs_diff(tx) == 2 || fy.abs_diff(ty) == 2, - _ => false, - } -} |
