summaryrefslogtreecommitdiff
path: root/ai/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ai/src/lib.rs')
-rw-r--r--ai/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/ai/src/lib.rs b/ai/src/lib.rs
index d14b1ea..7bee732 100644
--- a/ai/src/lib.rs
+++ b/ai/src/lib.rs
@@ -44,6 +44,11 @@ pub fn eval_singlethreaded(
} else {
let turn = board.turn();
let mut best_eval = f32::NEG_INFINITY;
+ let moves = PossibleMoves::moves(board);
+
+ if moves.is_empty() {
+ return 0.5;
+ }
for current_move in PossibleMoves::moves(board) {
let board = unsafe { current_move.apply_to(board) };