feat: debug tools for movegen/perft

This commit is contained in:
dogeystamp 2024-10-25 20:25:02 -04:00
parent 1b250f224d
commit 21add6fec8
2 changed files with 19 additions and 6 deletions

View File

@ -6,11 +6,10 @@ use chess_inator::movegen::LegalMoveGen;
use std::env;
fn main() {
for arg in env::args().skip(2) {
let board = Board::from_fen(&arg).unwrap();
let mvs = board.gen_moves();
for mv in mvs.into_iter() {
println!("{mv:?}")
}
let fen = env::args().nth(1).unwrap();
let board = Board::from_fen(&fen).unwrap();
let mvs = board.gen_moves();
for mv in mvs.into_iter() {
println!("{mv:?}")
}
}

14
src/bin/perft_tool.rs Normal file
View File

@ -0,0 +1,14 @@
//! Runs perft at depth for a given FEN.
use chess_inator::Board;
use chess_inator::fen::FromFen;
use chess_inator::movegen::perft;
use std::env;
fn main() {
let depth = env::args().nth(1).unwrap().parse::<usize>().unwrap();
let fen = env::args().nth(2).unwrap();
let mut board = Board::from_fen(&fen).unwrap();
let res = perft(depth, &mut board);
println!("{res}")
}