[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
19.1 The GNU Go Text Protocol | The Go Text Protocol | |
19.2 Protocol applications | ||
19.3 Protocol conventions | ||
19.4 Regression testing with GTP | ||
19.5 GTP command reference | Details on every GTP command |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GNU Go 3.0 introduced a new interface, the Go Text Protocol (GTP). The intention is to make an interface that is better suited for machine-machine communication than the ascii interface and simpler, more powerful, and more flexible than the Go Modem Protocol.
There are two versions of the protocol. Version 1 was used with GNU Go 3.0 and 3.2. GNU Go 3.4 uses version 2. The specification is available at http:http://www.lysator.liu.se/~gunnar/gtp/.
The GTP has two principal current applications: it is used
in the test suite (see section 20. Regression testing) and it is used to
communicate with gnugoclient
, which is not part
of the GNU Go distribution, but has been used to run GNU
Go on NNGS. Other potential uses might be any of the current
uses of the GMP, for which the GTP might serve as a replacement.
This would likely entail extension and standardization of
the protocol.
A sample GTP session may look as follows:
hannah 2289% ./interface/gnugo --quiet --mode gtp 1 loadsgf regression/games/incident156.sgf 249 =1 2 countlib C3 =2 4 3 findlib C3 =3 C4 B3 D3 B2 5 attack C3 =5 0 owl_attack C3 = 1 B4 3 owl_defend C3 =3 1 B5 owl_attack A2 ? vertex must not be empty quit = |
By specifying `--mode gtp' GNU Go starts in the GTP interface. No prompt is used, just start giving commands. The commands have the common syntax
[id] command_name [arguments] |
The command is exactly one line long, i.e. it ends as soon as a newline appears. It's not possible to give multiple commands on the same line. Before the command name an optional identity number can be specified. If present it must be an integer between 0 and 2^31-1. The id numbers may come in any order or be reused. The rest of the line after the command name is assumed to be arguments for the command. Empty lines are ignored, as is everything following a hash sign up to the end of the line.
If the command is successful, the response is of the form
=[id] result |
Here `=' indicates success and id
is the identity
number given in the command or the empty string if the id was
omitted. This is followed by the result, which is a text string
ending with two consecutive newlines.
If the command fails for some reason, the response takes the form
?[id] error_message |
Here `?' indicates failure, id
is as before, and
error_message
gives an explanation for the failure. This
string also ends with two consecutive newlines.
The available commands may always be listed using the single command
help
. Currently this gives the list below.
aa_confirm_safety all_legal analyze_eyegraph attack attack_either black block_off break_in boardsize captures clear_board clear_cache color combination_attack connect countlib cputime decrease_depths defend defend_both disconnect dragon_data dragon_status dragon_stones dump_stack echo echo_err estimate_score accuratelib accurate_approxlib experimental_score eval_eye final_score final_status final_status_list findlib finish_sgftrace fixed_handicap get_handicap get_random_seed set_random_seed genmove genmove_black genmove_white get_connection_node_counter get_life_node_counter get_owl_node_counter get_reading_node_counter get_trymove_counter gg_genmove gg-undo help increase_depths influence is_legal known_command komi get_komi ladder_attack level set_search_diamond reset_search_mask limit_search set_search_limit draw_search_area limit_search list_commands list_stones loadsgf name new_score analyze_semeai analyze_semeai_after_move tactical_analyze_semeai owl_attack owl_connection_defends owl_defend owl_does_attack owl_does_defend owl_substantial owl_threaten_attack owl_threaten_defense play popgo printsgf orientation place_free_handicap protocol_version query_boardsize query_orientation quit restricted_genmove reg_genmove report_uncertainty reset_connection_node_counter reset_life_node_counter reset_owl_node_counter reset_reading_node_counter reset_trymove_counter same_dragon set_free_handicap showboard is_surrounded does_surround surround_map start_sgftrace test_eyeshape time_left time_settings top_moves top_moves_black top_moves_white trymove tryko tune_move_ordering undo version white worm_cutstone worm_data worm_stones |
For exact specification of their arguments and results, See section 19.5 GTP command reference.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The protocol is asymmetric and involves two parties, which we may call `A' and `B'. `A' is typically some kind of arbiter or relay and `B' is a go engine. All communication is initiated by `A' in form of commands, to which `B' responds.
Potential setups include:
A (regression script) -- B (engine). |
A sets up a board position and asks B to e.g. generate a move or find an attack on a specific string.
A (GUI) -- B (engine) |
The GUI relays moves between the human and the engine and asks the engine to generate moves. Optionally the GUI may also use GTP to ask the engine which moves are legal or give a score when the game is finished.
B1 (engine 1) -- A (arbiter) -- B2 (engine 2) |
A relays moves between the two engines and alternately asks the engines to generate moves. This involves two different GTP channels, the first between A and B1, and the second between A and B2. There is no direct communication between B1 and B2. The arbiter dictates board size, komi, rules, etc.
The same as above except that B1 includes the arbiter functionality and the first GTP link is shortcut.
Go server -- A (relay) -- B (engine) |
A talks with a go server using whatever protocol is needed and listens for match requests. When one arrives it accepts it, starts the go engine and issues GTP commands to set up board size, komi, etc. and if a game is restarted it also sets up the position. Then it relays moves between the server and the engine and asks the engine to generate new moves when it is in turn.
Setups 1 and 5 are in active and regular use with GNU Go. Programs implementing setup 3 are also distributed with GNU Go (the files `interface/gtp_examples/twogtp' and `interface/gtp_examples/2ptkgo.pl').
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The GTP is currently unfinished and unstandardized. It is hoped that it will grow to fill the needs currently served by the GMP and perhaps other functions. As it is yet unstandardized, this section gives some general remarks which we hope will constrain its development. We also discuss how the GTP is implemented in GNU Go, for the benefit of anyone wishing to add new commands. Notice that the current set of GTP commands is a mix of generally useful ones and highly GNU Go specific ones. Only the former should be part of a standardized protocol while the latter should be private extensions.
The purpose of the protocol is machine-machine communication. It may be tempting to modify the protocol so that it becomes more comfortable for the human user, for example with an automatic showboard after every move. This is absolutely not the purpose of the protocol! Use the ascii interface instead if you're inclined to make such a change.
Newlines are implemented differently on different operating systems. On Unix, a newline is just a line feed LF (ascii \012). On DOS/Windows it is CRLF (\013\012). Thus whether GNU Go sends a carriage return with the line feed depends on which platform it is compiled for. The arbiter should silently discard carriage returns.
Applications using GTP should never have to guess about the basic
structure of the responses, defined above. The basic construction for
coding a GTP command can be found in gtp_countlib()
:
static int gtp_countlib(char *s) { int i, j; if (!gtp_decode_coord(s, &i, &j)) return gtp_failure("invalid coordinate"); if (p[i][j] == EMPTY) return gtp_failure("vertex must not be empty"); return gtp_success("%d", countlib(POS(i, j))); } |
The functions gtp_failure()
and gtp_success()
automatically ensures the specified response format, assuming the
strings they are printing do not end with a newline.
Sometimes the output is too complex for use with gtp_success, e.g. if
we want to print vertices, which gtp_success() doesn't
support. Then we have to fall back to the construction in e.g.
gtp_genmove_white()
:
static int gtp_genmove_white(char *s) { int i, j; UNUSED(s); if (genmove(&i, &j, WHITE) >= 0) play_move(POS(i, j), WHITE); gtp_start_response(GTP_SUCCESS); gtp_print_vertex(i, j); return gtp_finish_response(); } |
Here gtp_start_response()
writes the equal sign and the request id while
gtp_finish_response()
adds the final two newlines. The next example
is from gtp_influence()
:
gtp_start_response(GTP_SUCCESS); get_initial_influence(color, 1, white_influence, black_influence, influence_regions); print_influence(white_influence, black_influence, influence_regions); /* We already have one newline, thus can't use gtp_finish_response(). */ gtp_printf("\n"); return GTP_OK; |
As we have said, the response should be finished with two newlines. Here we have to finish up the response ourselves since we already have one newline in place.
One problem that can be expected to be common is that an engine happens to finish its response with three (or more) rather than two consecutive newlines. This is an error by the engine that the controller can easily detect and ignore. Thus a well behaved engine should not send stray newlines, but should they appear the controller should ignore them. The opposite problem of an engine failing to properly finish its response with two newlines will result in deadlock. Don't do this mistake!
Although it doesn't suffice in more complex cases, gtp_success() is by
far the most convenient construction when it does. For example,
the function gtp_report_uncertainty
takes a single argument
which is expected to be "on" or "off", after which it sets the
value of report_uncertainty
, a variable which affects
the form of future GTP responses, reports success, and exits. The
function is coded thus:
static int gtp_report_uncertainty(char *s) { if (!strncmp(s, "on", 2)) { report_uncertainty = 1; return gtp_success(""); } if (!strncmp(s, "off", 3)) { report_uncertainty = 0; return gtp_success(""); } return gtp_failure("invalid argument"); } |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GNU Go uses GTP for regression testing. These tests are implemented as files with GTP commands, which are fed to GNU Go simply by redirecting stdin to read from a file. The output is filtered so that equal signs and responses from commands without id numbers are removed. These results are then compared with expected results encoded in GTP comments in the file, using matching with regular expressions. More information can be found in the regression chapter (see section 20. Regression testing).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section lists the GTP command set along with some information about each command. Each entry in the list has the following fields:
For suggestions on how to make effective use of the GTP command set, See section 19.2 Protocol applications. Some of these commands are standard commands in the protocol, others are GNU Go private commands.
Without further ado, here is the big list (in no particular order):
Function: Quit Arguments: none Fails: never Returns: nothing Status: GTP version 2 standard command. |
Function: Report protocol version. Arguments: none Fails: never Returns: protocol version number Status: GTP version 2 standard command. |
Function: Report the name of the program. Arguments: none Fails: never Returns: program name Status: GTP version 2 standard command. |
Function: Report the version number of the program. Arguments: none Fails: never Returns: version number Status: GTP version 2 standard command. |
Function: Set the board size to NxN and clear the board. Arguments: integer Fails: board size outside engine's limits Returns: nothing Status: GTP version 2 standard command. |
Function: Find the current boardsize Arguments: none Fails: never Returns: board_size |
Function: Clear the board. Arguments: none Fails: never Returns: nothing Status: GTP version 2 standard command. |
Function: Set the orienation to N and clear the board Arguments: integer Fails: illegal orientation Returns: nothing |
Function: Find the current orientation Arguments: none Fails: never Returns: orientation |
Function: Set the komi. Arguments: float Fails: incorrect argument Returns: nothing Status: GTP version 2 standard command. |
Function: Get the komi Arguments: none Fails: never Returns: Komi |
Function: Play a black stone at the given vertex. Arguments: vertex Fails: invalid vertex, illegal move Returns: nothing Status: Obsolete GTP version 1 command. |
Function: Play a white stone at the given vertex. Arguments: vertex Fails: invalid vertex, illegal move Returns: nothing Status: Obsolete GTP version 1 command. |
Function: Play a stone of the given color at the given vertex. Arguments: color, vertex Fails: invalid vertex, illegal move Returns: nothing Status: GTP version 2 standard command. |
Function: Set up fixed placement handicap stones. Arguments: number of handicap stones Fails: invalid number of stones for the current boardsize Returns: list of vertices with handicap stones Status: GTP version 2 standard command. |
Function: Choose free placement handicap stones and put them on the board. Arguments: number of handicap stones Fails: invalid number of stones Returns: list of vertices with handicap stones Status: GTP version 2 standard command. |
Function: Put free placement handicap stones on the board. Arguments: list of vertices with handicap stones Fails: board not empty, bad list of vertices Returns: nothing Status: GTP version 2 standard command. |
Function: Get the handicap Arguments: none Fails: never Returns: handicap |
Function: Load an sgf file, possibly up to a move number or the first occurence of a move. Arguments: filename + move number, vertex, or nothing Fails: missing filename or failure to open or parse file Returns: color to play Status: GTP version 2 standard command. |
Function: Return the color at a vertex. Arguments: vertex Fails: invalid vertex Returns: "black", "white", or "empty" |
Function: List vertices with either black or white stones. Arguments: color Fails: invalid color Returns: list of vertices |
Function: Count number of liberties for the string at a vertex. Arguments: vertex Fails: invalid vertex, empty vertex Returns: Number of liberties. |
Function: Return the positions of the liberties for the string at a vertex. Arguments: vertex Fails: invalid vertex, empty vertex Returns: Sorted space separated list of vertices. |
Function: Determine which liberties a stone of given color will get if played at given vertex. Arguments: move (color + vertex) Fails: invalid color, invalid vertex, occupied vertex Returns: Sorted space separated list of liberties |
Function: Determine which liberties a stone of given color will get if played at given vertex. Arguments: move (color + vertex) Fails: invalid color, invalid vertex, occupied vertex Returns: Sorted space separated list of liberties Supposedly identical in behavior to the above function and can be retired when this is confirmed. |
Function: Tell whether a move is legal. Arguments: move Fails: invalid move Returns: 1 if the move is legal, 0 if it is not. |
Function: List all legal moves for either color. Arguments: color Fails: invalid color Returns: Sorted space separated list of vertices. |
Function: List the number of captures taken by either color. Arguments: color Fails: invalid color Returns: Number of captures. |
Function: Return the last move. Arguments: none Fails: no previous move known Returns: Color and vertex of last move. |
Function: Play a stone of the given color at the given vertex. Arguments: move (color + vertex) Fails: invalid color, invalid vertex, illegal move Returns: nothing |
Function: Play a stone of the given color at the given vertex, allowing illegal ko capture. Arguments: move (color + vertex) Fails: invalid color, invalid vertex, illegal move Returns: nothing |
Function: Undo a trymove or tryko. Arguments: none Fails: stack empty Returns: nothing |
Function: clear the caches. Arguments: none. Fails: never. Returns: nothing. |
Function: Try to attack a string. Arguments: vertex Fails: invalid vertex, empty vertex Returns: attack code followed by attack point if attack code nonzero. |
Function: Try to attack either of two strings Arguments: two vertices Fails: invalid vertex, empty vertex Returns: attack code against the strings. Guarantees there exists a move which will attack one of the two with attack_code, but does not return the move. |
Function: Try to defend a string. Arguments: vertex Fails: invalid vertex, empty vertex Returns: defense code followed by defense point if defense code nonzero. |
Function: Try to attack a string strictly in a ladder. Arguments: vertex Fails: invalid vertex, empty vertex Returns: attack code followed by attack point if attack code nonzero. |
Function: Increase depth values by one. Arguments: none Fails: never Returns: nothing |
Function: Decrease depth values by one. Arguments: none Fails: never Returns: nothing |
Function: Try to attack a dragon. Arguments: vertex Fails: invalid vertex, empty vertex Returns: attack code followed by attack point if attack code nonzero. |
Function: Try to defend a dragon. Arguments: vertex Fails: invalid vertex, empty vertex Returns: defense code followed by defense point if defense code nonzero. |
Function: Try to attack a dragon in 2 moves. Arguments: vertex Fails: invalid vertex, empty vertex Returns: attack code followed by the two attack points if attack code nonzero. |
Function: Try to defend a dragon with 2 moves. Arguments: vertex Fails: invalid vertex, empty vertex Returns: defense code followed by the 2 defense points if defense code nonzero. |
Function: Examine whether a specific move attacks a dragon. Arguments: vertex (move), vertex (dragon) Fails: invalid vertex, empty vertex Returns: attack code |
Function: Examine whether a specific move defends a dragon. Arguments: vertex (move), vertex (dragon) Fails: invalid vertex, empty vertex Returns: defense code |
Function: Examine whether a connection defends involved dragons. Arguments: vertex (move), vertex (dragon1), vertex (dragon2) Fails: invalid vertex, empty vertex Returns: defense code |
Function: Try to defend both of two strings Arguments: two vertices Fails: invalid vertex, empty vertex Returns: defend code for the strings. Guarantees there exists a move which will defend both of the two with defend_code, but does not return the move. |
Function: Determine whether capturing a string gives a living dragon Arguments: vertex Fails: invalid vertex, empty vertex Returns: 1 if dragon can live, 0 otherwise |
Function: Analyze a semeai Arguments: dragona, dragonb Fails: invalid vertices, empty vertices Returns: semeai defense result, semeai attack result, semeai move |
Function: Analyze a semeai after a move have been made. Arguments: color, vertex, dragona, dragonb Fails: invalid vertices Returns: semeai defense result, semeai attack result, semeai move |
Function: Analyze a semeai, not using owl Arguments: dragona, dragonb Fails: invalid vertices, empty vertices Returns: status of dragona, dragonb assuming dragona moves first |
Function: Try to connect two strings. Arguments: vertex, vertex Fails: invalid vertex, empty vertex, vertices of different colors Returns: connect result followed by connect point if successful. |
Function: Try to disconnect two strings. Arguments: vertex, vertex Fails: invalid vertex, empty vertex, vertices of different colors Returns: disconnect result followed by disconnect point if successful. |
Function: Try to break from string into area. Arguments: vertex, vertices Fails: invalid vertex, empty vertex. Returns: result followed by break in point if successful. |
Function: Try to block string from area. Arguments: vertex, vertices Fails: invalid vertex, empty vertex. Returns: result followed by block point if successful. |
Function: Evaluate an eye space Arguments: vertex Fails: invalid vertex Returns: Minimum and maximum number of eyes. If these differ an attack and a defense point are additionally returned. If the vertex is not an eye space or not of unique color, a single -1 is returned. |
Function: Determine status of a dragon. Arguments: optional vertex Fails: invalid vertex, empty vertex Returns: status ("alive", "critical", "dead", or "unknown"), attack point, defense point. Points of attack and defense are only given if the status is critical. If no vertex is given, the status is listed for all dragons, one per row in the format "A4: alive". FIXME: Should be able to distinguish between life in seki and independent life. Should also be able to identify ko. |
Function: Determine whether two stones belong to the same dragon. Arguments: vertex, vertex Fails: invalid vertex, empty vertex Returns: 1 if the vertices belong to the same dragon, 0 otherwise |
Function: Determine the unconditional status of a vertex. Arguments: vertex Fails: invalid vertex Returns: unconditional status ("undecided", "alive", "dead", "white_territory", "black_territory"). Occupied vertices can be undecided, alive, or dead. Empty vertices can be undecided, white territory, or black territory. |
Function: Find a move by color capturing something through a combination attack. Arguments: color Fails: invalid color Returns: Recommended move, PASS if no move found |
Function: If color can capture something through a combination attack, list moves by the opponent of color to defend against this attack. Arguments: color Fails: invalid color Returns: Recommended moves, PASS if no combination attack found. |
Function: Run atari_atari_confirm_safety(). Arguments: move, optional int Fails: invalid move Returns: success code, if failure also defending move |
Function: Generate and play the supposedly best black move. Arguments: none Fails: never Returns: a move coordinate or "PASS" (or "resign" if resignation_allowed). Status: Obsolete GTP version 1 command. |
Function: Generate and play the supposedly best white move. Arguments: none Fails: never Returns: a move coordinate (or "PASS") Status: Obsolete GTP version 1 command. |
Function: Generate and play the supposedly best move for either color. Arguments: color to move Fails: invalid color Returns: a move coordinate (or "PASS") Status: GTP version 2 standard command. |
Function: Generate the supposedly best move for either color. Arguments: color to move Fails: invalid color Returns: a move coordinate (or "PASS") Status: GTP version 2 standard command. |
Function: Generate the supposedly best move for either color. Arguments: color to move, optionally a random seed Fails: invalid color Returns: a move coordinate (or "PASS") This differs from reg_genmove in the optional random seed. |
Function: Generate the supposedly best move for either color from a choice of allowed vertices. Arguments: color to move, allowed vertices Fails: invalid color, invalid vertex, no vertex listed Returns: a move coordinate (or "PASS") |
Function: Generate and play the supposedly best move for either color, not passing until all dead opponent stones have been removed. Arguments: color to move Fails: invalid color Returns: a move coordinate (or "PASS") Status: KGS specific command. A similar command, but possibly somewhat different, will likely be added to GTP version 3 at a later time. |
Function: Set the playing level. Arguments: int Fails: incorrect argument Returns: nothing |
Function: Undo one move Arguments: none Fails: If move history is too short. Returns: nothing Status: GTP version 2 standard command. |
Function: Undo a number of moves Arguments: optional int Fails: If move history is too short. Returns: nothing |
Function: Set time allowance Arguments: int main_time, int byo_yomi_time, int byo_yomi_stones Fails: syntax error Returns: nothing Status: GTP version 2 standard command. |
Function: Report remaining time Arguments: color color, int time, int stones Fails: syntax error Returns: nothing Status: GTP version 2 standard command. |
Function: Compute the score of a finished game. Arguments: Optional random seed Fails: never Returns: Score in SGF format (RE property). Status: GTP version 2 standard command. |
Function: Report the final status of a vertex in a finished game. Arguments: Vertex, optional random seed Fails: invalid vertex Returns: Status in the form of one of the strings "alive", "dead", "seki", "white_territory", "black_territory", or "dame". |
Function: Report vertices with a specific final status in a finished game. Arguments: Status in the form of one of the strings "alive", "dead", "seki", "white_territory", "black_territory", or "dame". An optional random seed can be added. Fails: missing or invalid status string Returns: Vertices having the specified status. These are split with one string on each line if the vertices are nonempty (i.e. for "alive", "dead", and "seki"). Status: GTP version 2 standard command. However, "dame", "white_territory", and "black_territory" are private extensions. |
Function: Estimate the score Arguments: None Fails: never Returns: upper and lower bounds for the score |
Function: Estimate the score, taking into account which player moves next Arguments: Color to play Fails: Invalid color Returns: Score. This function generates a move for color, then adds the value of the move generated to the value of the position. Critical dragons are awarded to the opponent since the value of rescuing a critical dragon is taken into account in the value of the move generated. |
Function: Reset the count of life nodes. Arguments: none Fails: never Returns: nothing Note: This function is obsolete and only remains for backwards compatibility. |
Function: Retrieve the count of life nodes. Arguments: none Fails: never Returns: number of life nodes Note: This function is obsolete and only remains for backwards compatibility. |
Function: Reset the count of owl nodes. Arguments: none Fails: never Returns: nothing |
Function: Retrieve the count of owl nodes. Arguments: none Fails: never Returns: number of owl nodes |
Function: Reset the count of reading nodes. Arguments: none Fails: never Returns: nothing |
Function: Retrieve the count of reading nodes. Arguments: none Fails: never Returns: number of reading nodes |
Function: Reset the count of trymoves/trykos. Arguments: none Fails: never Returns: nothing |
Function: Retrieve the count of trymoves/trykos. Arguments: none Fails: never Returns: number of trymoves/trykos |
Function: Reset the count of connection nodes. Arguments: none Fails: never Returns: nothing |
Function: Retrieve the count of connection nodes. Arguments: none Fails: never Returns: number of connection nodes |
Function: Test an eyeshape for inconsistent evaluations Arguments: Eyeshape vertices Fails: Bad vertices Returns: Failure reports on stderr. |
Function: Compute an eyevalue and vital points for an eye graph Arguments: Eyeshape encoded in string Fails: Bad eyeshape, analysis failed Returns: Eyevalue, vital points |
Function: Returns elapsed CPU time in seconds. Arguments: none Fails: never Returns: Total elapsed (user + system) CPU time in seconds. |
Function: Write the position to stdout. Arguments: none Fails: never Returns: nothing Status: GTP version 2 standard command. |
Function: Dump stack to stderr. Arguments: none Fails: never Returns: nothing |
Function: Return information about the initial influence function. Arguments: color to move, what information Fails: never Returns: Influence data formatted like: 0.51 1.34 3.20 6.60 9.09 8.06 1.96 0.00 0.00 0.45 1.65 4.92 12.19 17.47 15.92 4.03 0.00 0.00 . . . 0.00 0.00 0.00 0.00 0.00 100.00 75.53 41.47 23.41 The available choices of information are: white_influence (float) black_influence (float) white_strength (float) black_strength (float) white_attenuation (float) black_attenuation (float) white_permeability (float) black_permeability (float) territory_value (float) influence_regions (int) non_territory (int) The encoding of influence_regions is as follows: 4 white stone 3 white territory 2 white moyo 1 white area 0 neutral -1 black area -2 black moyo -3 black territory -4 black stone |
Function: Return information about the influence function after a move. Arguments: move, what information Fails: never Returns: Influence data formatted like for initial_influence. |
Function: List probabilities of each move being played (when non-zero). If no previous genmove command has been issued, the result of this command will be meaningless. Arguments: none Fails: never Returns: Move, probabilty pairs, one per row. |
Function: Return the number of bits of uncertainty in the move. If no previous genmove command has been issued, the result of this command will be meaningless. Arguments: none Fails: never Returns: bits of uncertainty |
Function: Return information about the followup influence after a move. Arguments: move, what information Fails: never Returns: Influence data formatted like for initial_influence. |
Function: Return the information in the worm data structure. Arguments: optional vertex Fails: never Returns: Worm data formatted like: A19: color black size 10 effective_size 17.83 origin A19 liberties 8 liberties2 15 liberties3 10 liberties4 8 attack PASS attack_code 0 lunch B19 defend PASS defend_code 0 cutstone 2 cutstone2 0 genus 0 inessential 0 B19: color white . . . inessential 0 C19: ... If an intersection is specified, only data for this one will be returned. |
Function: List the stones of a worm Arguments: the location, "BLACK" or "WHITE" Fails: if called on an empty or off-board location Returns: list of stones |
Function: Return the cutstone field in the worm data structure. Arguments: non-empty vertex Fails: never Returns: cutstone |
Function: Return the information in the dragon data structure. Arguments: optional intersection Fails: never Returns: Dragon data formatted in the corresponding way to worm_data. |
Function: List the stones of a dragon Arguments: the location Fails: if called on an empty or off-board location Returns: list of stones |
Function: Return the information in the eye data structure. Arguments: color, vertex Fails: never Returns: eye data fields and values, one pair per row |
Function: Return the information in the half eye data structure. Arguments: vertex Fails: never Returns: half eye data fields and values, one pair per row |
Function: Start storing moves executed during reading in an sgf tree in memory. Arguments: none Fails: never Returns: nothing Warning: You had better know what you're doing if you try to use this command. |
Function: Finish storing moves in an sgf tree and write it to file. Arguments: filename Fails: never Returns: nothing Warning: You had better know what you're doing if you try to use this command. |
Function: Dump the current position as a static sgf file Arguments: filename Fails: missing filename Returns: nothing |
Function: Tune the parameters for the move ordering in the tactical reading. Arguments: MOVE_ORDERING_PARAMETERS integers Fails: incorrect arguments Returns: nothing |
Function: Echo the parameter Arguments: string Fails: never Returns: nothing |
Function: Echo the parameter to stdout AND stderr Arguments: string Fails: never Returns: nothing |
Function: List all known commands Arguments: none Fails: never Returns: list of known commands, one per line Status: GTP version 2 standard command. |
Function: Tell whether a command is known. Arguments: command name Fails: never Returns: "true" if command exists, "false" if not Status: GTP version 2 standard command. |
Function: Turn uncertainty reports from owl_attack and owl_defend on or off. Arguments: "on" or "off" Fails: invalid argument Returns: nothing |
Function: Get the random seed Arguments: none Fails: never Returns: random seed |
Function: Set the random seed Arguments: integer Fails: invalid data Returns: nothing |
Function: Determine if a dragon is surrounded Arguments: vertex (dragon) Fails: invalid vertex, empty vertex Returns: 1 if surrounded, 2 if weakly surrounded, 0 if not |
Function: Determine if a move surrounds a dragon Arguments: vertex (move), vertex (dragon) Fails: invalid vertex, empty (dragon, nonempty (move) Returns: 1 if (move) surrounds (dragon) |
Function: Report the surround map for dragon at a vertex Arguments: vertex (dragon), vertex (mapped location) Fails: invalid vertex, empty dragon Returns: value of surround map at (mapped location), or -1 if dragon not surrounded. |
Function: limit search, and establish a search diamond Arguments: pos Fails: invalid value Returns: nothing |
Function: unmark the entire board for limited search Arguments: none Fails: never Returns: nothing |
Function: sets the global variable limit_search Arguments: value Fails: invalid arguments Returns: nothing |
Function: mark a vertex for limited search Arguments: position Fails: invalid arguments Returns: nothing |
Function: Draw search area. Writes to stderr. Arguments: none Fails: never Returns: nothing |
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |