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

27 lines (26 loc) 867 B
export default class BitBoard { low: number; high: number; constructor(low?: number, high?: number); setBit(pos: number): void; clearBit(pos: number): BitBoard; and(other: BitBoard): BitBoard; or(other: BitBoard): BitBoard; xor(other: BitBoard): BitBoard; not(): BitBoard; equals(other: BitBoard): boolean; greaterThan(other: BitBoard): boolean; lessThan(other: BitBoard): boolean; isZero(): boolean; extractBits(): number[]; shiftRight(numBits: number): BitBoard; shiftLeft(numBits: number): BitBoard; bitScanForward(): number; hasSetBit(pos: number): boolean; bitScanReverse(): number; static fromPos(pos: number): BitBoard; static fromPositions(positions: number[]): BitBoard; static fromHex(hexNumberAsString: string): BitBoard; print(): void; printBinary(): void; }