[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: computer-go: SGF parser in C++
Hi Guido,
There seems to be no C++ source available anywhere (OpenGo reads only Ishi
format), but there are several for Java (JaGo for instance).
I will be writing my own parser very soon for the program I have been toying
with for the past 6 months (it's called DemaGo, the GUI is 95% finished and
is very nice looking).
Since there is no equivalent IMO on the Win32 platform of excellent UNIX
software such as CGoban (yes, I know about the port but it needs an X11
server or emulator) I decided to write one myself in C++ (Visual C++ 5). It
already has lots of nice features :
- multiple games (MDI) interface,
- double buffering (the display never jumps/flickers),
- 256 colors (palette) and true-color display support,
- nice resizeable board and stones (with smooth shadows under the stones and
"ray-tracing" quality stones),
- game tree pane which supports several games as defined in the SGF4 spec,
- rulesets support (for the time being I only check basic ko and suicide),
- User-selectable goban texture and sounds,
- Multiple undo/redo.
At first I tried a very high level approach for the parser module. It used a
grammar (sort of lex/yacc). I just entered the rules and it worked
perfectly! But I wanted to parse big files (700 Kb for example for a fuseki
database) in less than 10 seconds (as MGT), and this parser was much too
slow. It was also very strict and didn't accept several formats (older SGF
files, MGT's almost-SGF, etc.).
So I'll write a much simpler, hand-coded parser, which I'll be glad to post
ASAP.
Regards,
Jean-Pierre
-----Message d'origine-----
Hi!
Does anyone know of a parser for SGF written in C++?
Greetings and happy new year
Guido