Expand description
Magic bitboards for sliding piece attacks.
Replaces the ray-casting loop with a constant-time table lookup using precomputed magic multipliers.
Tables are initialized once at first use via OnceLock; masks,
magic numbers, and index bits are const arrays (zero indirection).
Functionsยง
- bishop_
attacks - Return the attack set for a bishop on
sqgiven theoccupiedboard. - queen_
attacks - Return the attack set for a queen (bishop + rook).
- rook_
attacks - Return the attack set for a rook on
sqgiven theoccupiedboard.