[bitboard] Make a few tweaks to some definitions in BitBoard
Use u64::MIN and u64::MAX to define the empty and full bitboards Write From<Square> as `1u64 << sq as u32` Write a doc test for BitBoard::is_single_square() Make library::RANKS and library::FILES pub(crate) instead of pub(super)
This commit is contained in:
parent
891b3ddbb9
commit
997621eea7
2 changed files with 16 additions and 5 deletions
|
@ -4,7 +4,7 @@ use crate::BitBoard;
|
|||
use chessfriend_core::{Color, Direction, Square};
|
||||
use std::sync::OnceLock;
|
||||
|
||||
pub(super) const RANKS: [BitBoard; 8] = [
|
||||
pub(crate) const RANKS: [BitBoard; 8] = [
|
||||
BitBoard(0xFF << 0 * 8),
|
||||
BitBoard(0xFF << 1 * 8),
|
||||
BitBoard(0xFF << 2 * 8),
|
||||
|
@ -15,7 +15,7 @@ pub(super) const RANKS: [BitBoard; 8] = [
|
|||
BitBoard(0xFF << 7 * 8),
|
||||
];
|
||||
|
||||
pub(super) const FILES: [BitBoard; 8] = [
|
||||
pub(crate) const FILES: [BitBoard; 8] = [
|
||||
BitBoard(0x0101010101010101 << 0),
|
||||
BitBoard(0x0101010101010101 << 1),
|
||||
BitBoard(0x0101010101010101 << 2),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue