Function cozy_chess::get_line_rays

source ·
pub const fn get_line_rays(from: Square, to: Square) -> BitBoard
Expand description

Get a ray on the board that passes through both squares, if it exists.

§Examples

let rays = get_line_rays(Square::D2, Square::G5);
assert_eq!(rays, bitboard! {
    . . . . . . . .
    . . . . . . . .
    . . . . . . . X
    . . . . . . X .
    . . . . . X . .
    . . . . X . . .
    . . . X . . . .
    . . X . . . . .
});