diff --git a/bitboard/src/library.rs b/bitboard/src/library.rs index 7435435..c92388a 100644 --- a/bitboard/src/library.rs +++ b/bitboard/src/library.rs @@ -1,12 +1,12 @@ // Eryn Wells -//! # The BitBoard Library +//! # The Bitboard Library //! -//! This module implements a collection of commonly used BitBoards that can be +//! This module implements a collection of commonly used bitboards that can be //! looked up efficiently as needed. //! //! The `library()` method returns a static instance of a `Library`, which -//! provides getters for all available BitBoards. +//! provides getters for all available bitboards. use crate::BitBoard; use chessfriend_core::{Color, Direction, Square}; @@ -28,29 +28,35 @@ pub(crate) const RANKS: [BitBoard; 8] = [ #[allow(clippy::identity_op)] #[allow(clippy::erasing_op)] pub(crate) const FILES: [BitBoard; 8] = [ - BitBoard(0x0101010101010101 << 0), - BitBoard(0x0101010101010101 << 1), - BitBoard(0x0101010101010101 << 2), - BitBoard(0x0101010101010101 << 3), - BitBoard(0x0101010101010101 << 4), - BitBoard(0x0101010101010101 << 5), - BitBoard(0x0101010101010101 << 6), - BitBoard(0x0101010101010101 << 7), + BitBoard(0x0101_0101_0101_0101 << 0), + BitBoard(0x0101_0101_0101_0101 << 1), + BitBoard(0x0101_0101_0101_0101 << 2), + BitBoard(0x0101_0101_0101_0101 << 3), + BitBoard(0x0101_0101_0101_0101 << 4), + BitBoard(0x0101_0101_0101_0101 << 5), + BitBoard(0x0101_0101_0101_0101 << 6), + BitBoard(0x0101_0101_0101_0101 << 7), ]; /// Bitboards representing the kingside of the board, per color. -pub(crate) const KINGSIDES: [BitBoard; 2] = - [BitBoard(0xF0F0F0F0F0F0F0F0), BitBoard(0x0F0F0F0F0F0F0F0F)]; +pub(crate) const KINGSIDES: [BitBoard; 2] = [ + BitBoard(0xF0F0_F0F0_F0F0_F0F0), + BitBoard(0x0F0F_0F0F_0F0F_0F0F), +]; /// Bitboards representing the queenside of the board, per color. -pub(crate) const QUEENSIDES: [BitBoard; 2] = - [BitBoard(0x0F0F0F0F0F0F0F0F), BitBoard(0xF0F0F0F0F0F0F0F0)]; +pub(crate) const QUEENSIDES: [BitBoard; 2] = [ + BitBoard(0x0F0F_0F0F_0F0F_0F0F), + BitBoard(0xF0F0_F0F0_F0F0_F0F0), +]; /// A bitboard representing the light squares. +#[allow(dead_code)] pub(crate) const LIGHT_SQUARES: BitBoard = BitBoard(0x5555 | 0x5555 << 16 | 0x5555 << 32 | 0x5555 << 48); /// A bitboad representing the dark squares +#[allow(dead_code)] pub(crate) const DARK_SQUARES: BitBoard = BitBoard(!LIGHT_SQUARES.0); pub(super) fn library() -> &'static MoveLibrary {