Sliding Pieces

From Chessprogramming wiki
Jump to: navigation, search

Home * Chess * Pieces * Sliding Pieces

Sliding Pieces can move an indefinite number of squares along a horizontal, vertical, or diagonal line until the edge of the board or another piece obstructs the ray of a line. This applies for bishops, rooks and queen. Sliding piece move generation is more extensive than generation of none sliding knight, pawn or king moves. With board arrays it requires a loop along the ray, scanning each square for emptiness to continue, or occupancy by own or opponent piece to break, combined with an off the board test to terminate the ray loop as well. However, such a loop may be designed in an efficient way generalized for all pieces as broached in Table-driven Move Generation and in Bruce Moreland's Programming Topics [1]. With bitboards one relies on the various techniques to generate attack sets, which further requires serialization to finally encode moves in move generation.

The advantage of the bitboard method seems the cheaper generation of moves to certain subsets of squares, for instance captures in quiescence search. Despite Fritz Reul demonstrated dense and efficient blocking loops in mailbox based board representations, and in conjunction with disjoint piece flags and piece-lists [2].

See also


  1. Move Table move generation from Bruce Moreland's Programming Topics
  2. Fritz Reul (2009). New Architectures in Computer Chess, Ph.D. Thesis, Chapter 2 Non-Bitboard Architectures

Up one Level