This commit is contained in:
Simon Gardling 2025-02-18 15:08:35 -05:00
parent 22bc4876e5
commit 1972707f88
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
3 changed files with 16 additions and 0 deletions

View File

@ -11,6 +11,12 @@ type BBBaseType = u64;
#[derive(Copy, Clone, PartialEq, Eq)]
pub struct BitBoard(BitArr!(for BOARD_AREA, in BBBaseType, Lsb0));
impl Default for BitBoard {
fn default() -> Self {
Self::new()
}
}
impl BitBoard {
pub const fn new() -> Self {
Self(bitarr!(BBBaseType, Lsb0; 0; BOARD_AREA))

View File

@ -131,6 +131,12 @@ impl fmt::Debug for Board {
}
}
impl Default for Board {
fn default() -> Self {
Self::new()
}
}
impl Board {
/// Create a new empty board
pub const fn new() -> Self {

View File

@ -92,6 +92,10 @@ impl FutureMoves {
self.arena.len()
}
pub fn is_empty(&self) -> bool {
self.len() == 0
}
/// Generate children for all children of `nodes`
fn extend_layers(&mut self) {
let mut next_nodes: Vec<usize> = (0..self.arena.len())