atw1020/sente

[sgf.load] How to handle games with handicap

Closed this issue · 5 comments

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?

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?

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

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?

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

Fixed in v0.4.3, Sorry that took so long