mwg API
    Preparing search index...

    Function startingChess

    • The standard opening array, white to move with every right intact.

      Returns ChessState

      import { startingChess, legalMoves } from '@datamoc/mw_games/board';

      const state = startingChess();
      console.log(state.turn); // 'white'
      console.log(legalMoves(state).length); // 20 - 16 pawn moves, 4 knight moves