We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d6ac67 commit 430d8c8Copy full SHA for 430d8c8
2 files changed
src/board.rs
@@ -260,8 +260,9 @@ impl Board {
260
self.state.repetition != 0 && self.state.repetition < ply
261
}
262
263
- pub const fn is_repetition(&self) -> bool {
264
- self.state.repetition != 0
+ pub fn has_repeated(&self) -> bool {
+ let end = self.state.plies_from_null.min(self.state.halfmove_clock as usize);
265
+ self.state_stack.iter().rev().take(end.saturating_sub(3)).any(|s| s.repetition != 0)
266
267
268
pub fn draw_by_fifty_move_rule(&self) -> bool {
src/tb.rs
@@ -117,7 +117,7 @@ pub fn rank_rootmoves(td: &mut ThreadData) {
117
0,
118
ep_square,
119
td.board.side_to_move() == Color::White,
120
- td.board.is_repetition(),
+ td.board.has_repeated(),
121
true,
122
tb_ptr,
123
);
0 commit comments