[bitboard] Implement BitBoard::is_single_square()

Returns true if there's only one square set in the bitboard.
This commit is contained in:
Eryn Wells 2024-01-28 15:51:57 -08:00
parent 0f664f6c80
commit cb48413ce7

View file

@ -78,6 +78,10 @@ impl BitBoard {
let sq_bb: BitBoard = sq.into();
*self &= !sq_bb
}
pub fn is_single_square(&self) -> bool {
self.0.is_power_of_two()
}
}
impl BitBoard {