[perft] Print the fen string of the board position
This commit is contained in:
parent
076cdfe66f
commit
f3b31d5514
1 changed files with 7 additions and 3 deletions
|
@ -1,4 +1,7 @@
|
||||||
use chessfriend_position::{Position, fen::FromFenStr, perft::Perft};
|
use chessfriend_position::{
|
||||||
|
Position,
|
||||||
|
fen::{FromFenStr, ToFenStr},
|
||||||
|
};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
|
@ -14,14 +17,15 @@ fn main() -> anyhow::Result<()> {
|
||||||
let args = Arguments::parse();
|
let args = Arguments::parse();
|
||||||
let depth = args.depth;
|
let depth = args.depth;
|
||||||
|
|
||||||
println!("depth {depth}");
|
|
||||||
|
|
||||||
let mut position = if let Some(fen) = args.fen {
|
let mut position = if let Some(fen) = args.fen {
|
||||||
Position::from_fen_str(&fen)?
|
Position::from_fen_str(&fen)?
|
||||||
} else {
|
} else {
|
||||||
Position::starting(None)
|
Position::starting(None)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
println!("fen \"{}\"", position.to_fen_str().unwrap());
|
||||||
|
println!("depth {depth}");
|
||||||
|
|
||||||
let nodes_searched = position.perft(depth);
|
let nodes_searched = position.perft(depth);
|
||||||
|
|
||||||
println!("nodes {nodes_searched}");
|
println!("nodes {nodes_searched}");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue