Function cozy_chess::get_king_moves

source ·
pub const fn get_king_moves(square: Square) -> BitBoard
Expand description

Get the king moves for a king on some square.

§Examples

let moves = get_king_moves(Square::D3);
assert_eq!(moves, bitboard! {
    . . . . . . . .
    . . . . . . . .
    . . . . . . . .
    . . . . . . . .
    . . X X X . . .
    . . X . X . . .
    . . X X X . . .
    . . . . . . . .
});