diff --git a/engine/src/bitboard/board.rs b/engine/src/bitboard/board.rs index b742d5c..d630c32 100644 --- a/engine/src/bitboard/board.rs +++ b/engine/src/bitboard/board.rs @@ -6,5 +6,23 @@ pub struct Board { pinned_squares: [u8; 64], // 0 -> E-W, 1 -> NE-SW, 2 -> N-S, 3 -> SE-NW, 4 -> no pin pin_mask: u64, // 1 -> pin, 0 -> no pin en_passant_square: u64, // 1 -> ep square, 0 -> no ep square - side_to_move: u8, // 0 -> white to play, 1 -> black to play + side_to_move: u8 // 0 -> white to play, 1 -> black to play +} + +impl Board { + + pub fn new_clear() -> Self { + let mut bit_board: Self = Self { + bitboards: [0x0000_0000_0000_0000; 12], + piece_board: [12; 64], + occupancy: [0x0000_0000_0000_0000; 3], + castling_rights: 0b0000_0000, + pinned_squares: [4; 64], + pin_mask: 0u64, + en_passant_square: 0x0000_0000_0000_0000, + side_to_move: 0 + }; + + return bit_board; + } } \ No newline at end of file