diff options
| author | Micha White <botahamec@outlook.com> | 2023-09-27 09:35:50 -0400 |
|---|---|---|
| committer | Micha White <botahamec@outlook.com> | 2023-09-27 09:35:50 -0400 |
| commit | 1b379403ab971e188483df5d580c39695db7f44a (patch) | |
| tree | f9d547fe9d4bf0fd7c8ddabcf5e6fd119a9ff6bf /cli/src/perft.rs | |
| parent | 10438fa9ae1dc4624ebb1780238d46d4b5d3f0eb (diff) | |
Big changes
Diffstat (limited to 'cli/src/perft.rs')
| -rw-r--r-- | cli/src/perft.rs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/cli/src/perft.rs b/cli/src/perft.rs deleted file mode 100644 index 535aec0..0000000 --- a/cli/src/perft.rs +++ /dev/null @@ -1,26 +0,0 @@ -use ai::{CheckersBitBoard, Move, PossibleMoves}; -use rayon::prelude::*; -use std::fmt::{Display, Formatter}; - -#[derive(Clone)] -struct PerftResult { - result: Vec<(Move, usize)>, -} - -pub fn positions(board: CheckersBitBoard, depth: usize) -> usize { - let moves = PossibleMoves::moves(board); - - if depth == 0 { - 1 - } else { - let mut total = 0; - - for current_move in moves { - // safety: we got this move out of the list of possible moves, so it's definitely valid - let board = unsafe { current_move.apply_to(board) }; - total += positions(board, depth - 1); - } - - total - } -} |
