Previous: Adding new GTP commands, Up: GTP
This section lists the GTP commands implemented in GNU Go along with some information about each command. Each entry in the list has the following fields:
Without further ado, here is the big list (in no particular order):
Arguments: none Fails: never Returns: nothing Status: GTP version 2 standard command.
Arguments: none Fails: never Returns: protocol version number Status: GTP version 2 standard command.
Arguments: none Fails: never Returns: program name Status: GTP version 2 standard command.
Arguments: none Fails: never Returns: version number Status: GTP version 2 standard command.
Arguments: integer Fails: board size outside engine's limits Returns: nothing Status: GTP version 2 standard command.
Arguments: none Fails: never Returns: board_size
Arguments: none Fails: never Returns: nothing Status: GTP version 2 standard command.
Arguments: integer Fails: illegal orientation Returns: nothing
Arguments: none Fails: never Returns: orientation
Arguments: float Fails: incorrect argument Returns: nothing Status: GTP version 2 standard command.
Arguments: none Fails: never Returns: Komi
Arguments: vertex Fails: invalid vertex, illegal move Returns: nothing Status: Obsolete GTP version 1 command.
Arguments: vertex Fails: invalid vertex, illegal move Returns: nothing Status: Obsolete GTP version 1 command.
Arguments: color, vertex Fails: invalid vertex, illegal move Returns: nothing Status: GTP version 2 standard command.
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.
Arguments: number of handicap stones Fails: invalid number of stones Returns: list of vertices with handicap stones Status: GTP version 2 standard command.
Arguments: list of vertices with handicap stones Fails: board not empty, bad list of vertices Returns: nothing Status: GTP version 2 standard command.
Arguments: none Fails: never Returns: handicap
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.
Arguments: vertex Fails: invalid vertex Returns: "black", "white", or "empty"
Arguments: color Fails: invalid color Returns: list of vertices
Arguments: vertex Fails: invalid vertex, empty vertex Returns: Number of liberties.
Arguments: vertex Fails: invalid vertex, empty vertex Returns: Sorted space separated list of vertices.
Arguments: move (color + vertex) Fails: invalid color, invalid vertex, occupied vertex Returns: Sorted space separated list of liberties
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.
Arguments: move Fails: invalid move Returns: 1 if the move is legal, 0 if it is not.
Arguments: color Fails: invalid color Returns: Sorted space separated list of vertices.
Arguments: color Fails: invalid color Returns: Number of captures.
Arguments: none Fails: no previous move known Returns: Color and vertex of last move.
Arguments: none Fails: never Returns: List of moves played in reverse order in format: color move (one move per line)
Arguments: move (color + vertex) Fails: invalid color, invalid vertex, illegal move Returns: nothing
Arguments: move (color + vertex) Fails: invalid color, invalid vertex, illegal move Returns: nothing
Arguments: none Fails: stack empty Returns: nothing
Arguments: none. Fails: never. Returns: nothing.
Arguments: vertex Fails: invalid vertex, empty vertex Returns: attack code followed by attack point if attack code nonzero.
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.
Arguments: vertex Fails: invalid vertex, empty vertex Returns: defense code followed by defense point if defense code nonzero.
Arguments: vertex (move), vertex (dragon) Fails: invalid vertex, empty vertex Returns: attack code
Arguments: vertex (move), vertex (dragon) Fails: invalid vertex, empty vertex Returns: attack code
Arguments: vertex Fails: invalid vertex, empty vertex Returns: attack code followed by attack point if attack code nonzero.
Arguments: none Fails: never Returns: nothing
Arguments: none Fails: never Returns: nothing
Arguments: vertex Fails: invalid vertex, empty vertex Returns: attack code followed by attack point if attack code nonzero.
Arguments: vertex Fails: invalid vertex, empty vertex Returns: defense code followed by defense point if defense code nonzero.
Arguments: vertex Fails: invalid vertex, empty vertex Returns: attack code followed by the two attack points if attack code nonzero.
Arguments: vertex Fails: invalid vertex, empty vertex Returns: defense code followed by the 2 defense points if defense code nonzero.
Arguments: vertex (move), vertex (dragon) Fails: invalid vertex, empty vertex Returns: attack code
Arguments: vertex (move), vertex (dragon) Fails: invalid vertex, empty vertex Returns: defense code
Arguments: vertex (move), vertex (dragon1), vertex (dragon2) Fails: invalid vertex, empty vertex Returns: defense code
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.
Arguments: vertex Fails: invalid vertex, empty vertex Returns: 1 if dragon can live, 0 otherwise
Arguments: dragona, dragonb Fails: invalid vertices, empty vertices Returns: semeai defense result, semeai attack result, semeai move
Arguments: color, vertex, dragona, dragonb Fails: invalid vertices Returns: semeai defense result, semeai attack result, semeai move
Arguments: dragona, dragonb Fails: invalid vertices, empty vertices Returns: status of dragona, dragonb assuming dragona moves first
Arguments: vertex, vertex Fails: invalid vertex, empty vertex, vertices of different colors Returns: connect result followed by connect point if successful.
Arguments: vertex, vertex Fails: invalid vertex, empty vertex, vertices of different colors Returns: disconnect result followed by disconnect point if successful.
Arguments: vertex, vertices Fails: invalid vertex, empty vertex. Returns: result followed by break in point if successful.
Arguments: vertex, vertices Fails: invalid vertex, empty vertex. Returns: result followed by block point if successful.
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.
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.
Arguments: vertex, vertex Fails: invalid vertex, empty vertex Returns: 1 if the vertices belong to the same dragon, 0 otherwise
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.
Arguments: color Fails: invalid color Returns: Recommended move, PASS if no move found
Arguments: color Fails: invalid color Returns: Recommended moves, PASS if no combination attack found.
Arguments: move, optional int Fails: invalid move Returns: success code, if failure also defending move
Arguments: none Fails: never Returns: a move coordinate or "PASS" Status: Obsolete GTP version 1 command.
Arguments: none Fails: never Returns: a move coordinate or "PASS" Status: Obsolete GTP version 1 command.
Arguments: color to move Fails: invalid color Returns: a move coordinate or "PASS" (or "resign" if resignation_allowed) Status: GTP version 2 standard command.
Arguments: color to move Fails: invalid color Returns: a move coordinate (or "PASS") Status: GTP version 2 standard command.
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.
Arguments: color to move, allowed vertices Fails: invalid color, invalid vertex, no vertex listed Returns: a move coordinate (or "PASS")
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.
Arguments: int Fails: incorrect argument Returns: nothing
Arguments: none Fails: If move history is too short. Returns: nothing Status: GTP version 2 standard command.
Arguments: optional int Fails: If move history is too short. Returns: nothing
Arguments: int main_time, int byo_yomi_time, int byo_yomi_stones Fails: syntax error Returns: nothing Status: GTP version 2 standard command.
Arguments: color color, int time, int stones Fails: syntax error Returns: nothing Status: GTP version 2 standard command.
Arguments: Optional random seed Fails: never Returns: Score in SGF format (RE property). Status: GTP version 2 standard command.
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".
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.
Arguments: None Fails: never Returns: upper and lower bounds for the score
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.
Arguments: none Fails: never Returns: nothing Note: This function is obsolete and only remains for backwards compatibility.
Arguments: none Fails: never Returns: number of life nodes Note: This function is obsolete and only remains for backwards compatibility.
Arguments: none Fails: never Returns: nothing
Arguments: none Fails: never Returns: number of owl nodes
Arguments: none Fails: never Returns: nothing
Arguments: none Fails: never Returns: number of reading nodes
Arguments: none Fails: never Returns: nothing
Arguments: none Fails: never Returns: number of trymoves/trykos
Arguments: none Fails: never Returns: nothing
Arguments: none Fails: never Returns: number of connection nodes
Arguments: Eyeshape vertices Fails: Bad vertices Returns: Failure reports on stderr.
Arguments: Eyeshape encoded in string Fails: Bad eyeshape, analysis failed Returns: Eyevalue, vital points
Arguments: none Fails: never Returns: Total elapsed (user + system) CPU time in seconds.
Arguments: none Fails: never Returns: nothing Status: GTP version 2 standard command.
Arguments: none Fails: never Returns: nothing
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
Arguments: move, what information Fails: never Returns: Influence data formatted like for initial_influence.
Arguments: none Fails: never Returns: Move, probabilty pairs, one per row.
Arguments: none Fails: never Returns: bits of uncertainty
Arguments: move, what information Fails: never Returns: Influence data formatted like for initial_influence.
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.
Arguments: the location, "BLACK" or "WHITE" Fails: if called on an empty or off-board location Returns: list of stones
Arguments: non-empty vertex Fails: never Returns: cutstone
Arguments: optional intersection Fails: never Returns: Dragon data formatted in the corresponding way to worm_data.
Arguments: the location Fails: if called on an empty or off-board location Returns: list of stones
Arguments: color, vertex Fails: never Returns: eye data fields and values, one pair per row
Arguments: vertex Fails: never Returns: half eye data fields and values, one pair per row
Arguments: none Fails: never Returns: nothing Warning: You had better know what you're doing if you try to use this command.
Arguments: filename Fails: never Returns: nothing Warning: You had better know what you're doing if you try to use this command.
Arguments: optional filename Fails: never Returns: nothing if filename, otherwise the sgf
Arguments: MOVE_ORDERING_PARAMETERS integers Fails: incorrect arguments Returns: nothing
Arguments: string Fails: never Returns: nothing
Arguments: string Fails: never Returns: nothing
Arguments: none Fails: never Returns: list of known commands, one per line Status: GTP version 2 standard command.
Arguments: command name Fails: never Returns: "true" if command exists, "false" if not Status: GTP version 2 standard command.
Arguments: "on" or "off" Fails: invalid argument Returns: nothing
Arguments: none Fails: never Returns: random seed
Arguments: integer Fails: invalid data Returns: nothing
Arguments: integer Fails: invalid data Returns: New random seed.
Arguments: vertex (dragon) Fails: invalid vertex, empty vertex Returns: 1 if surrounded, 2 if weakly surrounded, 0 if not
Arguments: vertex (move), vertex (dragon) Fails: invalid vertex, empty (dragon, nonempty (move) Returns: 1 if (move) surrounds (dragon)
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.
Arguments: pos Fails: invalid value Returns: nothing
Arguments: none Fails: never Returns: nothing
Arguments: value Fails: invalid arguments Returns: nothing
Arguments: position Fails: invalid arguments Returns: nothing
Arguments: none Fails: never Returns: nothing