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

Ko error #6

Closed
janos-r opened this issue Jan 20, 2021 · 3 comments
Closed

Ko error #6

janos-r opened this issue Jan 20, 2021 · 3 comments

Comments

@janos-r
Copy link

janos-r commented Jan 20, 2021

Hi there,
thank you for your great library. I was just using it in my rust yew project.
I just stumbled upon a situation. Just in some shapes, I get this situation, where after taking 2 stones, the API thinks that it is a ko, even though it's not.
In the screenshot, the transparent stone is the about to be placed stone, that is returning an error.
Would be great if you could have a look at it.
Thank you for your great library!

ps: I have this frontend in: https://github.com/janos-r/yewban

Screenshot from 2021-01-20 21-25-35

@janos-r
Copy link
Author

janos-r commented Jan 20, 2021

More pure reproduction:
These lines don't throw an error:

    game.try_play(Move::Play(0, 2)).unwrap();
    game.try_play(Move::Play(0, 1)).unwrap();
    game.try_play(Move::Play(0, 3)).unwrap();
    game.try_play(Move::Play(1, 2)).unwrap();
    game.try_play(Move::Play(1, 4)).unwrap();
    game.try_play(Move::Play(1, 3)).unwrap();
    game.try_play(Move::Play(0, 5)).unwrap();
//    game.try_play(Move::Play(2, 4)).unwrap();
//    game.try_play(Move::Play(2, 5)).unwrap();
    game.try_play(Move::Play(0, 4)).unwrap();
    game.try_play(Move::Play(0, 3)).unwrap();
    game.display_goban();

but if you uncomment the two moves, so that the capture also puts another stone in atari, the last move can't be taken back.

@Sagebati
Copy link
Owner

Hi, thanks for the report I'm looking into it. What are the rules used ? and version of the crate ?
ps: Awesome project

@Sagebati
Copy link
Owner

I corrected the issue, 0.16.0 is now yanked. the others versions don't seems to hove this issue. It was an issue in detecting the Ko point I forget to add a condition from a rework I had done for 0.16.0. I added you reproduction into my tests !

@Sagebati Sagebati reopened this Jan 21, 2021
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