From 41903be1433fd64d8b55a399c9984078c64ce38e Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 15 Jul 2022 21:58:46 +0200 Subject: [PATCH] Introduce 'Bitboard::ALL' --- src/board/bitboard/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/board/bitboard/mod.rs b/src/board/bitboard/mod.rs index edb1015..524cf33 100644 --- a/src/board/bitboard/mod.rs +++ b/src/board/bitboard/mod.rs @@ -11,6 +11,9 @@ impl Bitboard { /// An empty bitboard. pub const EMPTY: Bitboard = Bitboard(0); + /// A full bitboard. + pub const ALL: Bitboard = Bitboard(u64::MAX); + /// Array of bitboards representing the eight ranks, in order from rank 1 to rank 8. pub const RANKS: [Self; 8] = [ Bitboard(0b00000001_00000001_00000001_00000001_00000001_00000001_00000001_00000001), @@ -212,7 +215,7 @@ mod test { #[test] fn not() { - assert_eq!(!Bitboard::EMPTY, Bitboard(u64::MAX)); + assert_eq!(!Bitboard::EMPTY, Bitboard::ALL); } #[test]