SGF file download with AI review

So I did write a short perl script to replace all of the AW’s and AB’s with just W and B, except for where they’re meant to be which is at the start of the sgf file, to designate handicap stones for instance.

The other annoying thing is that when you download the ai reviews, the variations are misaligned by one move. (Well it’s either this or the colours are incorrect for the variations)

So when you go across one move in the tree, which should be a variation it’s actually the variation for the next move of the game. So that means it also won’t show properly as a variation.

It’s making my brain hurt looking at all the nested brackets, so I’ll probably see in the morning how to just shift all the variations by one move - I’m pretty sure it should just be putting in a pair of brackets at the right place.

I can update here with the perl code to fix it - it should only be like a couple of lines long.

Edit:
Actually I don’t know how to do an easy fix because it seems like some of the colour variations are just completely inverted - Blacks move is White and vice versa.

@flovo Would you be able to check anything I’m saying for example in this game https://online-go.com/game/21914092 . I’m pretty sure for example the last move variations for white are actually the wrong colour. As in when I look at the sgf, it’s giving white two moves in a row N10 being played by white, even though just the move before white plays P18, and then all the moves colours are inverted with respect to the correct variations.

I think this happens throughout as well.

(I’m picking this one just because it’s rather short, by comparison to other 19x19 games. It’s like 2000 lines long when you download it rather than like 16000 or something. )

1 Like