From 355bd2f20d4a9cb60cf9c3898fe54a22445266e6 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Fri, 9 Aug 2019 20:58:15 +0200 Subject: Avoid NaN --- src/strategy/minimax.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strategy/minimax.rs b/src/strategy/minimax.rs index 60a66b1..ce5e574 100644 --- a/src/strategy/minimax.rs +++ b/src/strategy/minimax.rs @@ -238,7 +238,7 @@ fn score(state: &GameBoard) -> Score { _ => 0., }; - let time_to_end = MAX_ROUNDS as f32 - state.round as f32; + let time_to_end = MAX_ROUNDS as f32 - state.round as f32 + 1.; let snowballs = state.players[0].snowballs() as f32 - state.players[1].snowballs() as f32; let bombs = state.players[0].bombs() as f32 - state.players[1].bombs() as f32; -- cgit v1.2.3