Add 'Bitboard::{LIGHT,DARK}_SQUARES
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bruno BELANYI 2022-07-18 00:43:48 +02:00
parent f1f6198e5f
commit 74d2a2cf6a

View file

@ -44,6 +44,12 @@ impl Bitboard {
/// The diagonal from [Square::A8] to [Square::H1]. /// The diagonal from [Square::A8] to [Square::H1].
pub const ANTI_DIAGONAL: Bitboard = Bitboard(0x0102040810204080); pub const ANTI_DIAGONAL: Bitboard = Bitboard(0x0102040810204080);
/// The light [Square]s on a board, e.g: [Square::H1].
pub const LIGHT_SQUARES: Bitboard = Bitboard(0x55AA55AA55AA55AA);
/// The dark [Square]s on a board, e.g: [Square::A1].
pub const DARK_SQUARES: Bitboard = Bitboard(0x55AA55AA55AA55AA);
/// Count the number of pieces in the [Bitboard]. /// Count the number of pieces in the [Bitboard].
#[inline(always)] #[inline(always)]
pub fn count(self) -> u32 { pub fn count(self) -> u32 {