From: Ryan Davis Date: 2009-10-04T17:14:00+09:00 Subject: Re: SGF Parser library released On Oct 3, 2009, at 22:21 , Aldric Giacomoni wrote: > http://github.com/Trevoke/SGFParser > > 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. Looks neat, but it really needs tests. Then it'll go from "working" to working. require 'test/unit' class TestSGFTree < Test::Unit::TestCase def test_load_string input = "something" expected = SGFNode.new "..." assert_equal expected, SGFTree.new.load_string(something) end end # and build it out from there P.S. You're mixing tabs and spaces and your indentation looks absolutely wack as a result. Stick to 2 spaces per indent.