This commit is contained in:
stefiosif
2025-02-08 19:49:39 +02:00
parent 614590b18e
commit a69c697892

View File

@@ -102,11 +102,16 @@ pub fn negamax(
let score = if legal_moves == 1 { let score = if legal_moves == 1 {
-negamax(game, -beta, -alpha, depth - 1, plies + 1, time, nodes, true)? -negamax(game, -beta, -alpha, depth - 1, plies + 1, time, nodes, true)?
} else { } else {
let mut lmr_reduction = 0;
if !in_check && !mv.is_capture() && depth > 2 && legal_moves > 3 {
lmr_reduction = 2;
}
let mut score = -negamax( let mut score = -negamax(
game, game,
-alpha - 1, -alpha - 1,
-alpha, -alpha,
depth - 1, depth - 1 - lmr_reduction,
plies + 1, plies + 1,
time, time,
nodes, nodes,