fix shift
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user