Next: Ladders in Joseki, Previous: Grid optimization, Up: Patterns
GNU Go includes a joseki compiler in patterns/joseki.c. This processes an SGF file (with variations) and produces a sequence of patterns which can then be fed back into mkpat. The joseki database is currently in files in patterns/ called hoshi.sgf, komoku.sgf, sansan.sgf, mokuhazushi.sgf and takamoku.sgf. This division can be revised whenever need arises.
The SGF files are transformed into the pattern database .db format by the program in joseki.c. These files are in turn transformed into C code by the program in mkpat.c and the C files are compiled and linked into the GNU Go binary.
Not every node in the SGF file contributes a pattern. The nodes which contribute patterns have the joseki in the upper right corner, with the boundary marked with a square mark and other information to determine the resulting pattern marked in the comments.
The intention is that the move valuation should be able to choose between the available variations by normal valuation. When this fails the primary workaround is to use shape values to increase or decrease the value. It is also possible to add antisuji variations to forbid popular suboptimal moves. As usual constraints can be used, e.g. to condition a variation on a working ladder.
The joseki format has the following components for each SGF node:
SQ
or MA
property) to decide how large part of the
board should be included in the pattern.
LB
property), which must be a single letter each.
If there is at least one label, a constraint diagram will be
produced with these labels.
In addition to this, rows starting with the following characters are recognized:
Example: If the comment in the SGF file looks like
F :C,shape(3) ;xplay_attack(A,B,C,D,*)
the generated pattern will have a colon line
:8,sjC,shape(3)
and a constraint
;xplay_attack(A,B,C,D,*)