mwg API
    Preparing search index...

    Function bitboardMoves

    • Every legal move for the side to play, in stable square order: pseudo-moves that leave their own king safe, each tried with makeMove and taken back with unmakeMove. Castling needs its rights, an empty passage and no check on the way over; en passant pins fall out of the make-and-test filter rather than special-casing.

      Parameters

      Returns BitboardMove[]

      import { bitboardMoves, startingBitboard } from '@datamoc/mwg/board';

      const moves = bitboardMoves(startingBitboard());
      console.log(moves.every((move) => move.from >= 0 && move.to < 64)); // true