Module shakmaty::attacks [−][src]
Attack and ray tables.
Example
use shakmaty::attacks; let occupied = Bitboard::from(Rank::Sixth); // blocking pieces let attacks = attacks::bishop_attacks(Square::C2, occupied); // . . . . . . . . // . . . . . . . . // 0 0 0 0 0 0 1 0 // . . . . . 1 . . // 1 . . . 1 . . . // . 1 . 1 . . . . // . . . . . . . . // . 1 . 1 . . . . assert!(attacks.contains(Square::G6)); assert!(!attacks.contains(Square::H7));
Functions
aligned | Tests if all three squares are aligned on a rank, file or diagonal. |
attacks | Looks up attacks for |
between | The squares between the two squares (bounds not included), or an empty
|
bishop_attacks | Looks up attacks for a bishop on |
bishop_mask | Gets the set of potential blocking squares for a bishop on |
king_attacks | Looks up attacks for a king on |
knight_attacks | Looks up attacks for a knight on |
pawn_attacks | Looks up attacks for a pawn of |
queen_attacks | Looks up attacks for a queen on |
ray | The rank, file or diagonal with the two squares (or an empty |
rook_attacks | Looks up attacks for a rook on |
rook_mask | Gets the set of potential blocking squares for a rook on |