diff --git a/perft/src/main.rs b/perft/src/main.rs index 70630ae..dece54c 100644 --- a/perft/src/main.rs +++ b/perft/src/main.rs @@ -1,4 +1,7 @@ -use chessfriend_position::{Position, fen::FromFenStr, perft::Perft}; +use chessfriend_position::{ + Position, + fen::{FromFenStr, ToFenStr}, +}; use clap::Parser; #[derive(Parser, Debug)] @@ -14,14 +17,15 @@ fn main() -> anyhow::Result<()> { let args = Arguments::parse(); let depth = args.depth; - println!("depth {depth}"); - let mut position = if let Some(fen) = args.fen { Position::from_fen_str(&fen)? } else { Position::starting(None) }; + println!("fen \"{}\"", position.to_fen_str().unwrap()); + println!("depth {depth}"); + let nodes_searched = position.perft(depth); println!("nodes {nodes_searched}");