diff options
| author | Mike White <botahamec@outlook.com> | 2021-09-18 13:01:46 -0400 |
|---|---|---|
| committer | Mike White <botahamec@outlook.com> | 2021-09-18 13:01:46 -0400 |
| commit | f0f18161c6a20db901cfd285491b8677e4c41851 (patch) | |
| tree | 63436c8b02cbef2d39a13fa06eded5c396ad14c9 /ai | |
| parent | 253ea9c999b1324ada0627ecf71ba48a22ddf234 (diff) | |
Implemented stalemate
Diffstat (limited to 'ai')
| -rw-r--r-- | ai/src/lib.rs | 5 |
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) }; |
