diff --git a/src/lookup.rs b/src/lookup.rs index aaabdf3..408c750 100644 --- a/src/lookup.rs +++ b/src/lookup.rs @@ -109,7 +109,7 @@ macro_rules! by_direction { }}; } -const RAYS: BySquare> = by_square!( +static RAYS: BySquare> = by_square!( square, ByDirection([Bitboard(0); 8]), by_direction!(direction, { @@ -123,7 +123,7 @@ const RAYS: BySquare> = by_square!( }) ); -const LINES: BySquare> = by_square!(a, BySquare([Bitboard(0); 64]), { +static LINES: BySquare> = by_square!(a, BySquare([Bitboard(0); 64]), { by_square!(b, Bitboard(0), { let mut res = Bitboard(0); loop_all_directions!(d, { @@ -136,7 +136,7 @@ const LINES: BySquare> = by_square!(a, BySquare([Bitboard(0); }) }); -const SEGMENTS: BySquare> = by_square!(a, BySquare([Bitboard(0); 64]), { +static SEGMENTS: BySquare> = by_square!(a, BySquare([Bitboard(0); 64]), { by_square!(b, Bitboard(0), { let mut res = 0; loop_all_directions!(d, { @@ -149,7 +149,7 @@ const SEGMENTS: BySquare> = by_square!(a, BySquare([Bitboard( }) }); -const KING_MOVES: BySquare = by_square!(sq, Bitboard(0), { +static KING_MOVES: BySquare = by_square!(sq, Bitboard(0), { let mut res = 0; loop_all_directions!(d, { if let Some(x) = sq.trans(d) { @@ -159,7 +159,7 @@ const KING_MOVES: BySquare = by_square!(sq, Bitboard(0), { Bitboard(res) }); -const KNIGHT_MOVES: BySquare = by_square!(s, Bitboard(0), { +static KNIGHT_MOVES: BySquare = by_square!(s, Bitboard(0), { let mut res = Bitboard(0); if let Some(s) = s.trans(Direction::North) { if let Some(s) = s.trans(Direction::NorthEast) { @@ -196,7 +196,7 @@ const KNIGHT_MOVES: BySquare = by_square!(s, Bitboard(0), { res }); -const PAWN_ATTACKS: ByColor> = { +static PAWN_ATTACKS: ByColor> = { by_color!(color, { let direction = match color { Color::White => Direction::North, @@ -278,7 +278,7 @@ const fn rook_premask(square: Square) -> Bitboard { Bitboard(premask) } -const MAGICS: (BySquare, BySquare, usize) = { +static MAGICS: (BySquare, BySquare, usize) = { let mut len: usize = 0; ( by_square!( @@ -353,7 +353,7 @@ struct Magic { } #[allow(long_running_const_eval)] -const MAGIC_TABLE: [Bitboard; MAGICS.2] = { +static MAGIC_TABLE: [Bitboard; MAGICS.2] = { let mut table = [Bitboard(0); MAGICS.2]; by_square!(square, (), { let Magic {