Function shakmaty::attacks::ray

source ·
pub fn ray(a: Square, b: Square) -> Bitboard
Expand description

The rank, file or diagonal with the two squares (or an empty Bitboard if they are not aligned).

§Example

use shakmaty::{attacks, Square};

let ray = attacks::ray(Square::E2, Square::G4);
// . . . . . . . .
// . . . . . . . .
// . . . . . . . .
// . . . . . . . 1
// . . . . . . 1 .
// . . . . . 1 . .
// . . . . 1 . . .
// . . . 1 . . . .