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.
e2e4
e7e8q
ChessMove
legalMoves
import { parseUciMove } from '@datamoc/mwg/board';console.log(parseUciMove('e2e4')); // { from: 12, to: 28 } Copy
import { parseUciMove } from '@datamoc/mwg/board';console.log(parseUciMove('e2e4')); // { from: 12, to: 28 }
Reads a UCI move (
e2e4,e7e8q) back into aChessMove. The inverse of what the book compiler writes; it checks the shape, not the legality, so the caller matches the result againstlegalMovesbefore playing it.