diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-02-26 23:48:54 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-02-26 23:48:54 +0300 |
commit | c31e8188ddb0a39eff3e59df94eed736f2490d8a (patch) | |
tree | 6bafc86b920aca9aaa3564ae2ff8874ea00ae3db | |
parent | 8e7ac2814c4a92eba79f9c626ad14ac0b7bfef3f (diff) | |
download | chessnost-c31e8188ddb0a39eff3e59df94eed736f2490d8a.tar.gz |
fix: correct UCI clock bugs
-rw-r--r-- | src/grossmeister/UCI.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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) |