From c31e8188ddb0a39eff3e59df94eed736f2490d8a Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 26 Feb 2023 23:48:54 +0300 Subject: fix: correct UCI clock bugs --- src/grossmeister/UCI.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/grossmeister/UCI.rs b/src/grossmeister/UCI.rs index 2c466a1..7d23e2d 100644 --- a/src/grossmeister/UCI.rs +++ b/src/grossmeister/UCI.rs @@ -41,7 +41,7 @@ impl Grossmeister { todo!() } "ucinewgame" => { - // TODO: clear transposition table + *self = Self::default() } "position" => { if let Some(token) = tokens.next() { @@ -126,7 +126,7 @@ impl Grossmeister { "binc" => { if let Some(time) = tokens.next() { let time: u64 = time.parse().unwrap(); - self.board.clock.increment[Color::White as usize] = Duration::from_millis(time); + self.board.clock.increment[Color::Black as usize] = Duration::from_millis(time); } } "movestogo" => {} @@ -156,7 +156,7 @@ impl Grossmeister { } let color = self.board.color(); - let duration = self.board.clock.time[color as usize] / 20 + self.board.clock.increment[color as usize]; + let duration = (self.board.clock.time[color as usize] + self.board.clock.increment[color as usize]) / 20; self.create_terminator_thread(duration); self.create_search_thread(u8::MAX) -- cgit v1.2.3