diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/board/engine.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/board/engine.rs b/src/board/engine.rs index ceee108..58c9eb5 100644 --- a/src/board/engine.rs +++ b/src/board/engine.rs @@ -223,6 +223,7 @@ impl Board { return (alpha, principal_variation) } } + (alpha, principal_variation) } @@ -287,7 +288,7 @@ impl Board { let mut depth = 1; let mut alpha = -INFINITY; let mut beta = INFINITY; - let window_size = 0.5; + let window_size = 0.25; loop { let search_result = self.negamax_search(alpha, beta, depth, deadline); @@ -299,18 +300,17 @@ impl Board { None => panic!("Could not find a move in time"), } } - if search_result.1.len() > 0 { depth += 1; alpha = search_result.0 - window_size; beta = search_result.0 + window_size; } else if search_result.0 <= alpha { // Alpha-cutoff println!("Alpha cutoff {} <= {:?}", search_result.0, (alpha, beta)); - alpha = search_result.0 - window_size; + alpha = search_result.0 - window_size * 4.0; continue; } else if search_result.0 >= beta { // Beta-cutoff println!("Beta cutoff {:?} <= {}", (alpha, beta), search_result.0); - beta = search_result.0 + window_size; + beta = search_result.0 + window_size * 4.0; continue; } else { panic!("Can this ever be possible? (probably not)"); |