most basic best move search

This commit is contained in:
Moritz 2025-11-14 23:32:52 +01:00
parent af2178abad
commit 9d527634eb
7 changed files with 105 additions and 4 deletions

View file

@ -2,8 +2,15 @@ use chess_engine::board::Board;
use chess_engine::movegen::generate_pseudo_legal_moves;
use chess_engine::movegen::legal_check::is_king_attacked;
use chess_engine::r#move::*;
use chess_engine::search::minimax;
use chess_engine::search::minimax::minimax;
fn main() {
let mut board = Board::from_fen("rnb1kbnr/pppppppp/8/8/8/4q3/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
let (opt_move, _) = minimax(&mut board, 5);
if let Some(mv) = opt_move {
println!("Found best move: {}", mv)
} else {
println!("No moves found")
}
}