From 643b6883847f8e489704f2f613213bf08f645385 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 18 Jul 2022 00:43:48 +0200 Subject: [PATCH] Add 'Bitboard::{LIGHT,DARK}_SQUARES --- src/board/bitboard/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/board/bitboard/mod.rs b/src/board/bitboard/mod.rs index 04b205a..092dba7 100644 --- a/src/board/bitboard/mod.rs +++ b/src/board/bitboard/mod.rs @@ -44,6 +44,12 @@ impl Bitboard { /// The diagonal from [Square::A8] to [Square::H1]. 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]. #[inline(always)] pub fn count(self) -> u32 {