From a3bef6f93a960ad51d7601ed8e53c6a83a532f71 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 22 Aug 2023 02:59:20 +0300 Subject: feat: improve UCI position fen moves case --- src/grossmeister/search.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/grossmeister/search.rs') diff --git a/src/grossmeister/search.rs b/src/grossmeister/search.rs index 7b40fab..cfe1e6d 100644 --- a/src/grossmeister/search.rs +++ b/src/grossmeister/search.rs @@ -236,14 +236,18 @@ impl Grossmeister { gradual_widening_counter += 1; beta = alpha + window_size * 0.1; alpha = search_result.0 - window_size * 2.0f32.powi(gradual_widening_counter); - println!("info score upperbound {:.0}", beta * 100.0); + if self.debug { + println!("info score upperbound {:.0}", beta * 100.0); + } continue; } if search_result.0 >= beta { // Beta-cutoff gradual_widening_counter += 1; alpha = beta - window_size * 0.1; beta = search_result.0 + window_size * 2.0f32.powi(gradual_widening_counter); - println!("info score lowerbound {:.0}", alpha * 100.0); + if self.debug { + println!("info score lowerbound {:.0}", alpha * 100.0); + } continue; } @@ -471,8 +475,7 @@ mod tests { #[test] fn stupid_knight_sac() { let fen = String::from("r3k1r1/pp3ppp/1q6/2ppPn2/6P1/1PPP1P2/P1N3KP/R2QR3 b - - 0 18"); - let mut board = Board::from_FEN(fen); - board.ply += 1; // TODO: remove me when FEN parsing includes side to move + let board = Board::from_FEN(fen); let mut gm = Grossmeister::new(board); let (_, pv) = gm.iterative_deepening(6); -- cgit v1.2.3