1.1.0 • Published 12 months ago
cm-polyglot v1.1.0
cm-polyglot
This is an ES6 port of the polyglot reading and handling parts of https://github.com/evilwan/stakelbase.
It allows the reading of chess opening books in the polyglot (.bin) format. It is used in the cm-engines-runner to handle opening books.
Usage
import {Polyglot} from "./src/cm-polyglot/Polyglot.js"
const polyglot = new Polyglot("./assets/books/openings.bin")
const startingPosition = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
console.log(startingPosition, await polyglot.getMovesFromFen(startingPosition))