diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2019-08-09 20:58:15 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2019-08-09 20:58:15 +0200 |
commit | 355bd2f20d4a9cb60cf9c3898fe54a22445266e6 (patch) | |
tree | dcd119a3ecf5370055142bcf9b5a075060601767 | |
parent | cd0c5b9d8c3f6a274018e0e60a4c0b82fc3598f3 (diff) |
Avoid NaN
-rw-r--r-- | src/strategy/minimax.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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; |