chess.js
chess.js copied to clipboard
scroll through moves?
Is it possible to scroll through moves? My use case is something like this:
var chess = new Chess();
chess.load_pgn(somePgn);
/* pseudocode follows */
for (let i = 0; i < 20; i++) {
chess.move(); /* I want it to apply the next move from the PGN already loaded */
console.log(chess.fen()); /* e.g. to build an opening explorer */
}
All the README code examples seem to be geared around me providing the input moves, vs scrolling through the moves of an existing game.
Short answer: No.
You could always get the history and then feed moves back in.