bitboard formatting
This commit is contained in:
parent
5eef461050
commit
c0eac2b175
@ -43,7 +43,7 @@ impl BitBoard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub const fn is_empty(&self) -> bool {
|
pub const fn is_empty(&self) -> bool {
|
||||||
self.0 == 0
|
self.0 == 0b0
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn east(&self, n: usize) -> Self {
|
pub const fn east(&self, n: usize) -> Self {
|
||||||
@ -82,10 +82,10 @@ impl BitBoard {
|
|||||||
|
|
||||||
// Mask for a specific column (e.g., col_mask(7) = 0x8080808080808080)
|
// Mask for a specific column (e.g., col_mask(7) = 0x8080808080808080)
|
||||||
const fn col_mask(col: CoordAxis) -> Self {
|
const fn col_mask(col: CoordAxis) -> Self {
|
||||||
let mut mask = 0;
|
let mut mask = 0b0;
|
||||||
let mut i = 0;
|
let mut i = 0b0;
|
||||||
while i < Board::AREA.0 {
|
while i < Board::AREA.0 {
|
||||||
mask |= 1 << (i + col);
|
mask |= 0b1 << (i + col);
|
||||||
i += Board::SIZE;
|
i += Board::SIZE;
|
||||||
}
|
}
|
||||||
Self(mask)
|
Self(mask)
|
||||||
@ -97,7 +97,7 @@ impl BitBoard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub const fn intersects(self, other: Self) -> bool {
|
pub const fn intersects(self, other: Self) -> bool {
|
||||||
(self.0 & other.0) > 0
|
(self.0 & other.0) > 0b0
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn bitor_assign(&mut self, other: Self) {
|
pub const fn bitor_assign(&mut self, other: Self) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user