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

24 lines (23 loc) 730 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.removeLowestBit = exports.removeHighestBit = exports.slideDown = exports.slideUp = void 0; function slideUp(attacks) { attacks = attacks.shiftLeft(8); return attacks; } exports.slideUp = slideUp; function slideDown(attacks) { attacks = attacks.shiftRight(8); return attacks; } exports.slideDown = slideDown; function removeHighestBit(attacks) { attacks = attacks.clearBit(attacks.bitScanReverse()); return attacks; } exports.removeHighestBit = removeHighestBit; function removeLowestBit(attacks) { attacks = attacks.clearBit(attacks.bitScanForward()); return attacks; } exports.removeLowestBit = removeLowestBit;