fix shift

This commit is contained in:
2025-03-04 14:10:17 -05:00
parent d82fff2e0a
commit 445f94daf0
2 changed files with 6 additions and 6 deletions

View File

@@ -3,6 +3,7 @@ use super::{
coords::{CoordPair, CoordPairInner},
CoordAxis,
};
use num::PrimInt;
use static_assertions::const_assert;
#[cfg(not(feature = "bitvec"))]
@@ -45,7 +46,7 @@ impl BitBoard {
// Directional shifts with edge masking (prevents wrapping)
pub const fn east(&self) -> Self {
let mask = !Self::col_mask(Board::BOARD_SIZE).0; // Mask to block column 7 bits
let mask = !Self::col_mask(Board::BOARD_SIZE - 1).0; // Mask to block column 7 bits
Self((self.0 & mask) << 1)
}
@@ -100,7 +101,7 @@ impl BitBoard {
}
pub fn intersects(self, other: Self) -> bool {
(self & other).count() > 0
(self.0 & other.0) > 0
}
pub fn union(self, other: Self) -> Self {