Skip to content

Commit

Permalink
slightly tune down the line of sight of threefold repetitions
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocodutra committed Nov 13, 2024
1 parent fe45438 commit 5ac58d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/chess/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub struct Position {
zobrist: Zobrist,
checkers: Bitboard,
pinned: Bitboard,
history: [[Option<NonZeroU16>; 48]; 2],
history: [[Option<NonZeroU16>; 32]; 2],
}

impl Default for Position {
Expand All @@ -180,7 +180,7 @@ impl Default for Position {
zobrist: board.zobrist(),
checkers: Default::default(),
pinned: Default::default(),
history: [[None; 48]; 2],
history: Default::default(),
board,
}
}
Expand Down Expand Up @@ -499,7 +499,7 @@ impl Position {

if role == Pawn || capture.is_some() {
self.board.halfmoves = 0;
self.history = [[None; 48]; 2];
self.history = Default::default();
} else {
self.board.halfmoves += 1;
let entries = self.history[turn as usize].len();
Expand Down Expand Up @@ -669,7 +669,7 @@ impl FromStr for Position {
checkers,
pinned,
zobrist: board.zobrist(),
history: [[None; 48]; 2],
history: Default::default(),
board,
})
}
Expand Down

0 comments on commit 5ac58d2

Please sign in to comment.