Open mliebelt opened 10 months ago
You are right, there is no API to do something like that. I checked the API again, at the moment, you can only do manual moves from one position to the next.
So let me write down the requirement: The user should be able to jump to any position in the game denoted by the move number. The move number is denoted by the array index of the half moves done. In the game e4 e5 Nf3 Nc6
the move numbers are: 1 e4 2 e5 3 Nf3 4 Nc6
.
What about variants? We cannot say which move number will be which move in which variant (at least not so simple). For the moment, this would only work for the main line.
There is a similar functionality already implemented, see #171 The ideas from that implementation could be moved.
Requirements would be:
1. e4 e5 2. Nf3 Nc6
will be: 0 e4 1 e5 2 Nf3 3 Nc6
.Did a quick hack, there are many things missing (yet). But demonstrates that jumping to a move is not a big deal ..
Discussed in https://github.com/mliebelt/PgnViewerJS/discussions/481