Chapter 8. Analyze Commands
GoGui allows to define analyze commands.
An analyze command is sent to the Go program and the response is displayed
graphically on the board.
The possible analyze commands are defined in the
configuration file ~/.gogui/analyze-commands.
All files beginning with ~/.gogui/analyze-commands
are loaded.
If none exists, a default file is created.
There is one line per command in the format:
type/label/command[/section[/scale]]
The command type determines what format the response is expected to be and
how it is interpreted and displayed.
It can be one of the following:
- bwboard
-
The response of the command is a board of strings.
Strings "b" or "black" will be displayed as black squares,
"w" or "white" as white squares, all other strings are
not displayed.
- cboard
-
The response of the command is a board of strings with color names.
They will be displayed as background colors for the fields.
Valid color names are blue, cyan, green, gray, magenta,
pink, red, and yellow. Unknown names or the special string ""
are ignored.
- dboard
-
The response of the command is a board of floating point
numbers that represent influence data.
They will be displayed as black (positive) and white (negative)
squares on the board.
The maximum size of a square is such that the corner would touch
the edge of a stone on that field and the edge length of the
square is proportional to the floating point number.
The numbers are expected to be between -1 and 1.
- hstring
-
The response is a multi-line text and will be displayed in a window
using syntax highlighting for lines beginning with a word ending with ':'
(bold), points and moves (blue), black and white (purple), numbers (green),
uppercase words (red).
- hpstring
-
Combines pstring and hstring.
- none
-
The response is not displayed.
- plist
-
The response of the command is a list of points.
All points will be marked on the board.
- pspairs
-
The response of the command is a list of point string pairs.
The strings are displayed as labels on the points.
- pstring
-
The response of the command is a text containing points.
If the text has only a single line, it will be displayed in the status line.
If it has multiple lines, a window will pop up.
All valid points contained in the text will be marked on the board.
- sboard
-
The response of the command is a board of strings.
A string should not be longer than 3-4 characters to fit on a point on the
board and may not contain white spaces.
The special string "" is used for no string on a point.
- string
-
The response of the command is a text.
If the text has only a single line, it will be displayed in the status line.
If it has multiple lines, a window will pop up.
- var
-
The response of the command is a variation of moves
containing points or passes.
Text not containing points is ignored.
They will be displayed as numbered stones on the board,
the current color to move is assumed to move first.
Additionally the response is displayed as a string.
- varb
-
Like var, but black is assumed to move first.
- varp
-
Like var, but the command needs a point argument
and the color at that point is assumed to move first.
- varpo
-
Like var, but the command needs a point argument
and the other color than the color at that point is assumed to move first.
- varw
-
Like var, but white is assumed to move first.
The label to use for this command in the menu.
The command to send to the Go program.
It can contain one of the following wildcards:
- %f
-
Will be replaced by a filename entered by the user.
- %m
-
Will be replaced by the color to play.
- %p
-
Will be replaced by the a point selected by the user.
- %P
-
Will be replaced by a list of points selected by the user.
The points are selected by clicking on the board.
The last point of the list is selected either by clicking with the
Ctrl key pressed, double-clicking or using the right
mouse button.
- %s
-
Will be replaced by an argument entered by the user.
The response to the command is searched first until a single line
containing the section name followed by a colon is found.
The text following from the next line on is parsed as the actual response.
Warning
Using section headers is deprecated and will not be supported in the future.
It is recommended that Go engines output only one of the response types
described above.
If the type is dboard, the numbers are scaled by
this factor.
Warning
Using scaling factors is deprecated and will not be supported in the future.
It is recommended that Go engines scale influence data as described for the
type dboard above.