MagicBitboards

dicechess.engine.movegen.MagicBitboards

Magic Bitboards implementation for sliding pieces (Bishops and Rooks).

Magic Bitboards provide O(1) lookup for sliding piece attacks by hashing the current board occupancy into a precomputed attack table.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def bishopAttacks(sq: Square, occupancy: Bitboard): Bitboard

Returns bishop attacks given a square and board occupancy.

Returns bishop attacks given a square and board occupancy.

Attributes

Generates bishop attacks using a slow classical approach.

Generates bishop attacks using a slow classical approach.

Attributes

Generates the occupancy mask for a bishop on a given square. Excludes the edges of the board.

Generates the occupancy mask for a bishop on a given square. Excludes the edges of the board.

Attributes

def queenAttacks(sq: Square, occupancy: Bitboard): Bitboard

Returns queen attacks given a square and board occupancy.

Returns queen attacks given a square and board occupancy.

Attributes

def rookAttacks(sq: Square, occupancy: Bitboard): Bitboard

Returns rook attacks given a square and board occupancy.

Returns rook attacks given a square and board occupancy.

Attributes

def rookAttacksClassic(sq: Square, occupancy: Bitboard): Bitboard

Generates rook attacks using a slow classical approach.

Generates rook attacks using a slow classical approach.

Attributes

Generates the occupancy mask for a rook on a given square. Excludes the relevant board edges.

Generates the occupancy mask for a rook on a given square. Excludes the relevant board edges.

Attributes

Concrete fields

val BishopRelevantBits: Array[Int]
val RookRelevantBits: Array[Int]