Refactor based on clippy, move tt to search module and call iterative deepening from uci_go

This commit is contained in:
stefiosif
2024-11-03 01:19:12 +02:00
parent 802bdcdb37
commit 1b28de5064
11 changed files with 67 additions and 92 deletions

View File

@@ -2,15 +2,7 @@ use crate::{board::game::Game, evaluation::evaluation::evaluate_position, movege
use super::move_ordering::score_by_mvv_lva;
pub fn quiescence(
game: &mut Game,
mut alpha: i32,
beta: i32,
nodes: &mut u64,
depth: u8,
) -> (Option<Move>, i32) {
*nodes += 1;
pub fn quiescence(game: &mut Game, mut alpha: i32, beta: i32, depth: u8) -> (Option<Move>, i32) {
if depth == 0 {
return (None, evaluate_position(&game.board));
}
@@ -37,7 +29,7 @@ pub fn quiescence(
continue;
}
let move_score = -quiescence(game, -beta, -alpha, nodes, depth - 1).1;
let move_score = -quiescence(game, -beta, -alpha, depth - 1).1;
game.unmake_move();
if move_score >= beta {