[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:
Eryn Wells 2024-02-11 08:44:11 -07:00
parent 891b3ddbb9
commit 997621eea7
2 changed files with 16 additions and 5 deletions

View file

@ -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),