UNPKG

chess-legal-moves

Version:

Analyses a given chess game position in Fen notation to return legal moves and provides the next game position after a given move

21 lines (20 loc) 1.16 kB
import BitBoard from '../../BitBoard/BitBoard'; declare type IPositiveDirection = 'no' | 'noEa' | 'noWe' | 'ea'; declare type INegativeDirection = 'so' | 'soEa' | 'soWe' | 'we'; /** * Gets the reachable squares from a square in a positive direction * @param occupiedBoard a Bitboard representing all the pieces on the board * @param direction a string representing a positive direction * @param position the index of a position * @returns a Bitboard representing the reachable squares from a square in a positive direction */ export declare function getPositiveRayAttacks(occupiedBoard: BitBoard, direction: IPositiveDirection, position: number): BitBoard; /** * Gets the reachable squares from a square in a negative direction * @param occupiedBoard a Bitboard representing all the pieces on the board * @param direction a string representing a negative direction * @param position the index of a position * @returns a Bitboard representing the reachable squares from a square in a negative direction */ export declare function getNegativeRayAttacks(occupiedBoard: BitBoard, direction: INegativeDirection, position: number): BitBoard; export {};