Add Null-move pruning
This commit is contained in:
@@ -18,12 +18,15 @@ pub fn iterative_deepening(
|
||||
|
||||
for depth in 1..=max_depth {
|
||||
if time.exceed_soft_limit() {
|
||||
write_response(&mut io::stdout(), &Response::Info("Soft limit exceeded in negamax".to_string()))?;
|
||||
write_response(
|
||||
&mut io::stdout(),
|
||||
&Response::Info("Soft limit exceeded in negamax".to_string()),
|
||||
)?;
|
||||
return Ok(best_move);
|
||||
}
|
||||
|
||||
let mut nodes = 0;
|
||||
let score = negamax::negamax(game, MIN_SCORE, MAX_SCORE, depth, 0, time, &mut nodes);
|
||||
let score = negamax::negamax(game, MIN_SCORE, MAX_SCORE, depth, 0, time, &mut nodes, true);
|
||||
|
||||
if let Err(e) = score {
|
||||
write_response(&mut io::stdout(), &Response::Info(format!("{e}")))?;
|
||||
@@ -36,7 +39,7 @@ pub fn iterative_deepening(
|
||||
&mut io::stdout(),
|
||||
&log_depth_results(
|
||||
depth,
|
||||
time.instant.elapsed().as_millis() as u64,
|
||||
time.instant.elapsed().as_secs(),
|
||||
nodes,
|
||||
time.nps(nodes),
|
||||
score?,
|
||||
|
||||
Reference in New Issue
Block a user