Add LMR
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user