use chess_game::{ChessGame, Move10};
fn main() {
println!("ChessGame prototype starting...");
let mut game = ChessGame::new();
println!("Starting position loaded. ply = 0");
game.push_move(9, 22); game.push_move(0, 40); game.push_move(11, 12); game.push_move(0, 32);
println!(
"Before castling: king at {:?}, rook at {:?}",
game.mapping.piece_square[15], game.mapping.piece_square[13], );
game.push_move(15, 6); println!(
"After White castling, ply = {}, king at {:?}, rook at {:?}",
game.ply,
game.mapping.piece_square[15], game.mapping.piece_square[13], );
for _ in 0..5 {
game.pop_move();
}
println!(
"After undo all, king at {:?}, rook at {:?}",
game.mapping.piece_square[15], game.mapping.piece_square[13], );
game.push_move(0, 16); game.push_move(9, 55); game.push_move(0, 24); game.push_move(11, 54);
game.push_move(1, 17);
println!(
"Before Black castling: king at {:?}, rook at {:?}",
game.mapping.piece_square[31], game.mapping.piece_square[29], );
game.push_move(15, 62); println!(
"After Black castling, ply = {}, king at {:?}, rook at {:?}",
game.ply,
game.mapping.piece_square[31], game.mapping.piece_square[29], );
for _ in 0..6 {
game.pop_move();
}
println!(
"After undo all (Black), king at {:?}, rook at {:?}",
game.mapping.piece_square[31], game.mapping.piece_square[29], );
game.push_move(4, 28); println!("After White pawn double-step, EP target = {:?}", game.en_passant_target);
game.push_move(0, 40); game.push_move(4, 36); game.push_move(3, 35); println!("After Black pawn double-step, EP target = {:?}", game.en_passant_target);
game.push_move(4, 43); println!(
"After EP capture, captured_bits = {:032b}, square 35 now occupied by {:?}",
game.captured_bits,
game.mapping.who_on_square(43) );
}