diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-09-03 17:32:31 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-09-03 18:23:52 +0300 |
commit | 9927af55dd12bc5eca7ff17e9dbc2665c42fcfb7 (patch) | |
tree | bfbb33376f8d9ba84de21d626e6fb8dda4d1471a /src/grossmeister/search.rs | |
parent | 81b0addcc9d5ff2b428981ca88ee0acdec4db2a9 (diff) | |
download | chessnost-master.tar.gz |
Diffstat (limited to 'src/grossmeister/search.rs')
-rw-r--r-- | src/grossmeister/search.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/grossmeister/search.rs b/src/grossmeister/search.rs index fb7e385..2d20e3a 100644 --- a/src/grossmeister/search.rs +++ b/src/grossmeister/search.rs @@ -44,8 +44,7 @@ impl Grossmeister { let mut principal_variation = Vec::new(); let color = self.board.color(); - if self.board.positions.iter().filter(|p| **p == self.board.hash).count() >= 3 { - // Draw by repetition + if self.board.threefold_repetition() { return (0.0, principal_variation); } @@ -176,9 +175,8 @@ impl Grossmeister { pub fn quiscence(&mut self, mut alpha: f32, mut beta: f32, root_distance: u8) -> f32 { let color = self.board.color(); - if self.board.positions.iter().filter(|p| **p == self.board.hash).count() >= 3 { - // Draw by repetition - return 0.0; + if self.board.threefold_repetition() { + return 0.0 } // Mate distance pruning |