diff options
Diffstat (limited to 'src/grossmeister/search.rs')
-rw-r--r-- | src/grossmeister/search.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/grossmeister/search.rs b/src/grossmeister/search.rs index cfe1e6d..d8db1e2 100644 --- a/src/grossmeister/search.rs +++ b/src/grossmeister/search.rs @@ -271,6 +271,10 @@ impl Grossmeister { } } + if result.is_none() { + println!("info string could not find move in time, will re-run depth-1 search to avoid panic"); + result = Some(self.negamax_search(-INFINITY, INFINITY, 1, &mut root_killers)) + } match result { Some(r) => { @@ -281,10 +285,7 @@ impl Grossmeister { println!(); r } - None => { - println!("info string could not find move in time"); - panic!("Could not find a move in time"); - } + None => panic!("No move found by search") } } |