Open jmt1423 opened 6 months ago
@jmt1423 You are right, it is not possible to add a variation on the first move with addMove
, because, if you set the parameter previous
to null, the method assumes, that you want to add the move at the end of the main history.
I don't have a quick idea how to solve this, do you have one?
Maybe setting the string "start" as parameter previous
in that case?
const history = new History()
history.addMove("e4")
history.addMove("d4", "start")
history.addMove("e5")
Hey! Love the project and what I can do with it, I was just wondering if it is possible to add a variation on the first move of the game with pgn.history.addMove().
So as an example the variation tree should look like:
If it isn't possible I'd be happy to try and work on a solution and create a PR for it, but would like some clarification before I start trying a different solution. Thanks!