mwg API
    Preparing search index...

    Function bitboardFromChess

    • Reads a chess.ts position onto bitboards: the bridge the differential tests cross in both directions, and the way a FEN reaches the fast board.

      Parameters

      Returns BitboardState

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

      const moves = bitboardMoves(bitboardFromChess(startingChess()));
      console.log(moves.length); // 20 - the opening position's own count