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

[sgf.load] How to handle games with handicap #45

Closed
artphi opened this issue Aug 16, 2022 · 5 comments
Closed

[sgf.load] How to handle games with handicap #45

artphi opened this issue Aug 16, 2022 · 5 comments

Comments

@artphi
Copy link

artphi commented Aug 16, 2022

Hi,
I'm having a little fun coding a SGF to GIF converter.
It works pretty well for now, but I have a problem with handicap games.
When running the code:

...
game = sgf.load(name + ".sgf")
for s in game.get_default_sequence():
        move_sequence = game.get_default_sequence()[:1]
        game.play_sequence(move_sequence)
...

I get this error that pops:

File "C:\Users\olivi\Documents\SGFtoGIF\main.py", line 19, in start
    game.play_sequence(move_sequence)
sente.exceptions.IllegalMoveException: It is not currently white's turn

Am I doing something wrong?

@atw1020
Copy link
Owner

atw1020 commented Aug 16, 2022

Hi artphi, thank you for the issue. The problem could be an incorrectly formatted SGF file or it could be a bug. Could you please upload the SGF file you are trying to open?

@artphi
Copy link
Author

artphi commented Aug 17, 2022

Files.zip
Hi atw1020,
Thank you for the reply.
Here are two SGF files.
A 9x9 and a 19x19 with handicap.
I have the same problem with both files.
They are created from OGS

@atw1020
Copy link
Owner

atw1020 commented Aug 17, 2022

The sente SGF parser seems to be failing to parse handicaps which is a bug, thank you for reporting it. I'll try to fix it sometime in the next few days. May I add your files to the sente tests?

@artphi
Copy link
Author

artphi commented Aug 17, 2022

Thanks for the feedback!
Yes of course you can use the files.

@atw1020
Copy link
Owner

atw1020 commented Oct 21, 2022

Fixed in v0.4.3, Sorry that took so long

@atw1020 atw1020 closed this as completed Oct 21, 2022
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