feat: debug tools for movegen/perft
This commit is contained in:
parent
1b250f224d
commit
21add6fec8
@ -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
14
src/bin/perft_tool.rs
Normal 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}")
|
||||
}
|
Loading…
Reference in New Issue
Block a user