Constant poirebot::game::pieces::DIAGONALS [−][src]
pub const DIAGONALS: &[BitBoard; 15];
The 15 diagonals parallel to the main diagonal. Starts from the bottom to the top, with the main diagonal in the middle:
- index 0: h1
- index 1: g1 -> h2 …
- index 7: a1 to h8 (main diagonal)
- index 8: a2 to g8 …
- index 14: a8
A trick to get the diagonal matching a tile is to use the index
7 + rank - file
(0-indexed) Or just use the providedget_main_diagonal
.