diff options
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 |