chess.js icon indicating copy to clipboard operation
chess.js copied to clipboard

scroll through moves?

Open kevinludwig opened this issue 8 years ago • 1 comments

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.

kevinludwig avatar Feb 08 '17 00:02 kevinludwig

Short answer: No.

You could always get the history and then feed moves back in.

BillyWM avatar Feb 08 '17 04:02 BillyWM