SGF stands for Smart Game Format, it's best known for storing go games,
but also stores chess, backgammon and a whole bunch of other similar
games.
I've got a 'working' version of an SGF parser. I have issues with KGS
records, I believe it's due to the way I handle ']' characters within
comments.
If you have time, please take a look at the code (it's quite short) and
let me know what you think, or whatever suggestions you may have.
Thanks in advance.
···
--
Posted via http://www.ruby-forum.com/.
Ryan Davis wrote:
Looks neat, but it really needs tests. Then it'll go from "working" to
working.
P.S. You're mixing tabs and spaces and your indentation looks
absolutely wack as a result. Stick to 2 spaces per indent.
Hi Ryan, thanks for the input. I'll fix that indentation. Do you know
any particular place to read up on how to create tests, or will any
appropriate google search get me something decent?
···
--
Posted via http://www.ruby-forum.com/\.
Ryan Davis wrote:
Looks neat, but it really needs tests. Then it'll go from "working" to
working.
Ryan, or whomever else may be reading this, I've done some updates to
the code, and it actually works as it should now, which is always nice.
I've also implemented some basic cucumber testing, which turned out to
almost be fun 
The library, again, is at GitHub - Trevoke/SGFParser: A Ruby library to parse SGF (Smart Game Format) files, best-known for holding weiqi / go game records
I was wondering if anyone had any better ideas for the implementation -
the SGF format is pretty much a tree, and so I've basically implemented
a linked list. It's not particularly ruby-ish and that bugs me, but I
couldn't think of an elegant solution. Any ideas, however wacky they may
be?
···
--
Posted via http://www.ruby-forum.com/\.