Looks a position up in the book: its continuations, plus the ECO code and name where a known line ends there (mid-line transpositions carry moves but no name). Pure and total: an unknown key is a miss, never an error.
import { probeBook, startingChess } from '@datamoc/mwg/board';const book = { version: 1 as const, positions: { 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -': { moves: ['b2b4'], }, },};console.log(probeBook(book, startingChess())?.moves); // ['b2b4'] Copy
import { probeBook, startingChess } from '@datamoc/mwg/board';const book = { version: 1 as const, positions: { 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -': { moves: ['b2b4'], }, },};console.log(probeBook(book, startingChess())?.moves); // ['b2b4']
Looks a position up in the book: its continuations, plus the ECO code and name where a known line ends there (mid-line transpositions carry moves but no name). Pure and total: an unknown key is a miss, never an error.