LeaperAttacks

dicechess.engine.movegen.LeaperAttacks
object LeaperAttacks

Precomputed attack tables for leaping pieces (Knights and Kings).

Since leapers are not blocked by other pieces, their attacks can be completely pre-calculated at JVM startup for all 64 squares.

Attributes

Source
LeaperAttacks.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

inline def kingAttacksFor(sq: Square): Bitboard

Returns all squares attacked by a King on the given square.

Returns all squares attacked by a King on the given square.

Value parameters

sq

any valid board square

Attributes

Returns

bitboard of all squares adjacent to sq (1–8 squares)

Source
LeaperAttacks.scala
inline def knightAttacksFor(sq: Square): Bitboard

Returns all squares attacked by a Knight on the given square.

Returns all squares attacked by a Knight on the given square.

Value parameters

sq

any valid board square

Attributes

Returns

bitboard of all squares the Knight can jump to (1–8 squares)

Source
LeaperAttacks.scala

Concrete fields

val kingAttacks: Array[Bitboard]

Precomputed attack bitboards for a King on any given square.

Precomputed attack bitboards for a King on any given square.

Attributes

Source
LeaperAttacks.scala
val knightAttacks: Array[Bitboard]

Precomputed attack bitboards for a Knight on any given square.

Precomputed attack bitboards for a Knight on any given square.

Attributes

Source
LeaperAttacks.scala