[explorer, perft, position] Move node count into a new PerftCounters struct

This commit is contained in:
Eryn Wells 2025-06-19 11:33:35 -07:00
parent 4ce7e89cdb
commit 0f5a538f0a
3 changed files with 47 additions and 19 deletions

View file

@ -7,6 +7,7 @@ use clap::Parser;
#[derive(Parser, Debug)]
#[command(name = "Perft")]
struct Arguments {
#[arg(long, short, value_name = "INT")]
depth: usize,
#[arg(long, short, value_name = "FEN")]
@ -26,9 +27,9 @@ fn main() -> anyhow::Result<()> {
println!("fen \"{}\"", position.to_fen_str().unwrap());
println!("depth {depth}");
let nodes_searched = position.perft(depth);
let counters = position.perft(depth);
println!("nodes {nodes_searched}");
println!("\n{counters}");
Ok(())
}