Add repetition detection

This commit is contained in:
stefiosif
2025-01-19 20:15:23 +02:00
parent 1c7100f510
commit 29d69b5ab1
3 changed files with 40 additions and 0 deletions

View File

@@ -24,6 +24,10 @@ pub fn negamax(
bail!("Time is up! In Negamax");
}
if plies != 0 && game.in_repetition() {
return Ok(0);
}
if depth == 0 {
let q_score = quiescence(game, alpha, beta, time_info).map_err(|e| anyhow!("{e}"))?;
return Ok(q_score);