[position, perft] Move Perft into the position crate

Move the Perft trait into the position crate, and let the perft binary call into
that.

Amend Position::make_move to return a bool in the Ok case that indicates whether
the position has been seen before. Use this to decide whether to continue
recursing during the Perft run. I haven't seen that this makes a difference in
the counts returned by Perft yet.
This commit is contained in:
Eryn Wells 2025-06-16 09:01:58 -07:00
parent f0b6cb5f08
commit 7744dd06f0
4 changed files with 82 additions and 39 deletions

View file

@ -9,5 +9,6 @@ pub use chessfriend_board::{fen, PlacePieceError, PlacePieceStrategy};
pub use chessfriend_moves::{GeneratedMove, ValidateMove};
pub use position::Position;
pub mod perft;
#[macro_use]
pub mod testing;