Add LMR
This commit is contained in:
@@ -102,11 +102,16 @@ pub fn negamax(
|
||||
let score = if legal_moves == 1 {
|
||||
-negamax(game, -beta, -alpha, depth - 1, plies + 1, time, nodes, true)?
|
||||
} else {
|
||||
let mut lmr_reduction = 0;
|
||||
if !in_check && !mv.is_capture() && depth > 2 && legal_moves > 3 {
|
||||
lmr_reduction = 2;
|
||||
}
|
||||
|
||||
let mut score = -negamax(
|
||||
game,
|
||||
-alpha - 1,
|
||||
-alpha,
|
||||
depth - 1,
|
||||
depth - 1 - lmr_reduction,
|
||||
plies + 1,
|
||||
time,
|
||||
nodes,
|
||||
|
||||
Reference in New Issue
Block a user