aboutsummaryrefslogtreecommitdiff
path: root/src/grossmeister/search.rs
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-08-22 02:59:20 +0300
committereug-vs <eugene@eug-vs.xyz>2023-08-22 05:56:11 +0300
commita3bef6f93a960ad51d7601ed8e53c6a83a532f71 (patch)
treefffffe84df9c1e4903ccf0fd48db099758078a60 /src/grossmeister/search.rs
parentbc599d145a8d3a5e69128bc9e702ac7a32d73a4c (diff)
downloadchessnost-a3bef6f93a960ad51d7601ed8e53c6a83a532f71.tar.gz
feat: improve UCI position fen moves case
Diffstat (limited to 'src/grossmeister/search.rs')
-rw-r--r--src/grossmeister/search.rs11
1 files changed, 7 insertions, 4 deletions
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);