diff options
| author | Botahamec <botahamec@outlook.com> | 2021-08-22 10:56:09 -0400 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2021-08-22 10:56:09 -0400 |
| commit | 1b7437fabde41a0a5720da33a589e6e07274e63d (patch) | |
| tree | 387c88d37b6586555ea99bdfd799d22d32fee206 /ai/src | |
| parent | 3e194a1ba1c90847e74cc0a5128532c625798899 (diff) | |
Removed deprecated constant
Diffstat (limited to 'ai/src')
| -rw-r--r-- | ai/src/lib.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ai/src/lib.rs b/ai/src/lib.rs index c5b60f0..cdd8f2e 100644 --- a/ai/src/lib.rs +++ b/ai/src/lib.rs @@ -1,5 +1,3 @@ -use std::f32::NEG_INFINITY; - pub use model::{CheckersBitBoard, Move, PieceColor, PossibleMoves}; const KING_WORTH: u32 = 2; @@ -33,9 +31,9 @@ fn eval(depth: usize, board: CheckersBitBoard) -> f32 { eval_position(board) } else { let turn = board.turn(); - let mut best_eval = -NEG_INFINITY; + let mut best_eval = f32::NEG_INFINITY; for current_move in PossibleMoves::moves(board) { - let board = unsafe {current_move.apply_to(board)}; + let board = unsafe { current_move.apply_to(board) }; let current_eval = if board.turn() != turn { -eval(depth - 1, board) } else { @@ -49,4 +47,4 @@ fn eval(depth: usize, board: CheckersBitBoard) -> f32 { best_eval } -}
\ No newline at end of file +} |
