Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Multiple variations to history fails with invalid move error #10

Open
pouyaSamie opened this issue Aug 9, 2021 · 1 comment
Open

Comments

@pouyaSamie
Copy link

pouyaSamie commented Aug 9, 2021

Hi

if you try to add more than 3 variations to a move it will fail with the invalid move error.

should add a variant and render it => fail
Error: invalid move

these moves are valid I tested them on lichess.

from the History test I tried to change the history test like this

    it("should add a variant and render it", () => {
    const history = new History();
    const ply1 = history.addMove("e4");
    history.addMove("e6");
    history.addMove("d3");
    history.addMove("d5");
    history.addMove("Nd2");

    history.addMove("e5", ply1);
    history.addMove("f3", ply1);
    history.addMove("e6", ply1);
    history.addMove("Ne2", ply1);
    assert.equals(history.moves[1].variations.length, 4);
  });

if I manage to fix this issue I will post the solution here.
also, I can send a pull request for render variations.

@pouyaSamie pouyaSamie changed the title History Multiple variation fails Add Multiple variations to history fails with invalid move error Aug 9, 2021
@shaack
Copy link
Owner

shaack commented Aug 11, 2021

Thanks for your report. I will take a look to the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants