Function shakmaty::attacks::bishop_mask [−][src]
pub fn bishop_mask(sq: Square) -> Bitboard
Expand description
Gets the set of potential blocking squares for a bishop on sq
.
Example
let mask = attacks::bishop_mask(Square::D5);
// 0 . . . . . 0 .
// . 1 . . . 1 . .
// . . 1 . 1 . . .
// . . . 0 . . . .
// . . 1 . 1 . . .
// . 1 . . . 1 . .
// 0 . . . . . 1 .
// . . . . . . . 0
assert_eq!(mask.count(), 9);