Return early if king is under check and small refactorings

This commit is contained in:
stefiosif
2024-09-04 18:57:00 +03:00
parent fec27b0d02
commit 0815837cd5
4 changed files with 29 additions and 42 deletions

View File

@@ -5,7 +5,7 @@ use std::{
use crate::{
board::game::Game,
evaluation::evaluation::{MAX_EVAL, MIN_EVAL},
evaluation::{MAX_SCORE, MIN_SCORE},
movegen::r#move::Move,
search,
};
@@ -139,8 +139,8 @@ pub fn uci_go(go: &mut SplitWhitespace, game: &mut Game) -> Result<Move, String>
}
Ok(search::negamax::negamax(
game,
MIN_EVAL,
MAX_EVAL,
MIN_SCORE,
MAX_SCORE,
params.depth.unwrap_or(MAX_DEPTH),
0,
)