mwg API
    Preparing search index...

    Function parseUciMove

    • Reads a UCI move (e2e4, e7e8q) back into a ChessMove. The inverse of what the book compiler writes; it checks the shape, not the legality, so the caller matches the result against legalMoves before playing it.

      Parameters

      • uci: string

      Returns ChessMove

      import { parseUciMove } from '@datamoc/mwg/board';

      console.log(parseUciMove('e2e4')); // { from: 12, to: 28 }