Add magic bitboard generation

This commit is contained in:
Bruno BELANYI 2022-07-22 18:42:05 +02:00
parent 3f00c6d1fc
commit a04b1f3a42
4 changed files with 69 additions and 4 deletions

View file

@ -2,7 +2,6 @@ use crate::board::{Bitboard, File, Rank, Square};
use crate::movegen::bishop::bishop_moves;
use crate::movegen::rook::rook_moves;
#[allow(unused)] // FIXME: remove once used
pub fn generate_bishop_mask(square: Square) -> Bitboard {
let rays = bishop_moves(square, Bitboard::EMPTY);
@ -14,7 +13,6 @@ pub fn generate_bishop_mask(square: Square) -> Bitboard {
rays - mask
}
#[allow(unused)] // FIXME: remove once used
pub fn generate_rook_mask(square: Square) -> Bitboard {
let rays = rook_moves(square, Bitboard::EMPTY);