Status: GTP version 2 standard command.
@item protocol_version: Report protocol version.
Returns: protocol version number
Status: GTP version 2 standard command.
@item name: Report the name of the program.
Status: GTP version 2 standard command.
@item version: Report the version number of the program.
Status: GTP version 2 standard command.
@item boardsize: Set the board size to NxN and clear the board.
Fails: board size outside engine's limits
Status: GTP version 2 standard command.
@item query_boardsize: Find the current boardsize
@item clear_board: Clear the board.
Status: GTP version 2 standard command.
@item orientation: Set the orienation to N and clear the board
Fails: illegal orientation
@cindex query_orientation
@item query_orientation: Find the current orientation
@item komi: Set the komi.
Fails: incorrect argument
Status: GTP version 2 standard command.
@item get_komi: Get the komi
@item black: Play a black stone at the given vertex.
Fails: invalid vertex, illegal move
Status: Obsolete GTP version 1 command.
@item playwhite: Play a white stone at the given vertex.
Fails: invalid vertex, illegal move
Status: Obsolete GTP version 1 command.
@item play: Play a stone of the given color at the given vertex.
Fails: invalid vertex, illegal move
Status: GTP version 2 standard command.
@item fixed_handicap: 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.
@cindex place_free_handicap
@item place_free_handicap: 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.
@cindex set_free_handicap
@item set_free_handicap: Put free placement handicap stones on the board.
Arguments: list of vertices with handicap stones
Fails: board not empty, bad list of vertices
Status: GTP version 2 standard command.
@item get_handicap: Get the handicap
@item loadsgf: 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
Status: GTP version 2 standard command.
@item color: Return the color at a vertex.
Returns: "black", "white", or "empty"
@item list_stones: List vertices with either black or white stones.
Returns: list of vertices
@item countlib: Count number of liberties for the string at a vertex.
Fails: invalid vertex, empty vertex
Returns: Number of liberties.
@item findlib: Return the positions of the liberties for the string at a vertex.
Fails: invalid vertex, empty vertex
Returns: Sorted space separated list of vertices.
@item accuratelib: 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
@cindex accurate_approxlib
@item accurate_approxlib: 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.
@item is_legal: Tell whether a move is legal.
Returns: 1 if the move is legal, 0 if it is not.
@item all_legal: List all legal moves for either color.
Returns: Sorted space separated list of vertices.
@item captures: List the number of captures taken by either color.
Returns: Number of captures.
@item last_move: Return the last move.
Fails: no previous move known
Returns: Color and vertex of last move.
@item move_history: Print the move history in reverse order
Returns: List of moves played in reverse order in format:
color move (one move per line)
@item invariant_hash: Return the rotation/reflection invariant board hash.
Returns: Invariant hash for the board as a hexadecimal number.
@cindex invariant_hash_for_moves
@item invariant_hash_for_moves: Return the rotation/reflection invariant board hash obtained by playing all the possible moves for the
Returns: List of moves + invariant hash as a hexadecimal number,
one pair of move + hash per line.
@item trymove: Play a stone of the given color at the given vertex.
Arguments: move (color + vertex)
Fails: invalid color, invalid vertex, illegal move
@item tryko: 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
@item popgo: Undo a trymove or tryko.
@item clear_cache: clear the caches.
@item attack: Try to attack a string.
Fails: invalid vertex, empty vertex
Returns: attack code followed by attack point if attack code nonzero.
@item attack_either: Try to attack either of two strings
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.
@item defend: Try to defend a string.
Fails: invalid vertex, empty vertex
Returns: defense code followed by defense point if defense code nonzero.
@item does_attack: Examine whether a specific move attacks a string tactically.
Arguments: vertex (move), vertex (dragon)
Fails: invalid vertex, empty vertex
@item does_defend: Examine whether a specific move defends a string tactically.
Arguments: vertex (move), vertex (dragon)
Fails: invalid vertex, empty vertex
@item ladder_attack: Try to attack a string strictly in a ladder.
Fails: invalid vertex, empty vertex
Returns: attack code followed by attack point if attack code nonzero.
@item increase_depths: Increase depth values by one.
@item decrease_depths: Decrease depth values by one.
@item owl_attack: Try to attack a dragon.
Fails: invalid vertex, empty vertex
Returns: attack code followed by attack point if attack code nonzero.
@item owl_defend: Try to defend a dragon.
Fails: invalid vertex, empty vertex
Returns: defense code followed by defense point if defense code nonzero.
@cindex owl_threaten_attack
@item owl_threaten_attack: Try to attack a dragon in 2 moves.
Fails: invalid vertex, empty vertex
Returns: attack code followed by the two attack points if
@cindex owl_threaten_defense
@item owl_threaten_defense: Try to defend a dragon with 2 moves.
Fails: invalid vertex, empty vertex
Returns: defense code followed by the 2 defense points if
@item owl_does_attack: Examine whether a specific move attacks a dragon.
Arguments: vertex (move), vertex (dragon)
Fails: invalid vertex, empty vertex
@item owl_does_defend: Examine whether a specific move defends a dragon.
Arguments: vertex (move), vertex (dragon)
Fails: invalid vertex, empty vertex
@cindex owl_connection_defends
@item owl_connection_defends: Examine whether a connection defends involved dragons.
Arguments: vertex (move), vertex (dragon1), vertex (dragon2)
Fails: invalid vertex, empty vertex
@item defend_both: Try to defend both of two strings
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.
@item owl_substantial: Determine whether capturing a string gives a living dragon
Fails: invalid vertex, empty vertex
Returns: 1 if dragon can live, 0 otherwise
@item analyze_semeai: Analyze a semeai
Arguments: dragona, dragonb
Fails: invalid vertices, empty vertices
Returns: semeai defense result, semeai attack result, semeai move
@cindex analyze_semeai_after_move
@item analyze_semeai_after_move: Analyze a semeai after a move have been made.
Arguments: color, vertex, dragona, dragonb
Returns: semeai defense result, semeai attack result, semeai move
@cindex tactical_analyze_semeai
@item tactical_analyze_semeai: Analyze a semeai, not using owl
Arguments: dragona, dragonb
Fails: invalid vertices, empty vertices
Returns: status of dragona, dragonb assuming dragona moves first
@item connect: 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.
@item disconnect: 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.
@item break_in: Try to break from string into area.
Arguments: vertex, vertices
Fails: invalid vertex, empty vertex.
Returns: result followed by break in point if successful.
@item block_off: Try to block string from area.
Arguments: vertex, vertices
Fails: invalid vertex, empty vertex.
Returns: result followed by block point if successful.
@item eval_eye: Evaluate an eye space
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,
@item dragon_status: 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.
@item same_dragon: 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
@cindex unconditional_status
@item unconditional_status: Determine the unconditional status of a 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.
@cindex combination_attack
@item combination_attack: Find a move by color capturing something through a combination attack.
Returns: Recommended move, PASS if no move found
@cindex combination_defend
@item combination_defend: If color can capture something through a combination attack, list moves by the opponent of color
to defend against this attack.
Returns: Recommended moves, PASS if no combination attack found.
@cindex aa_confirm_safety
@item aa_confirm_safety: Run atari_atari_confirm_safety().
Arguments: move, optional int
Returns: success code, if failure also defending move
@item genmove_black: Generate and play the supposedly best black move.
Returns: a move coordinate or "PASS"
Status: Obsolete GTP version 1 command.
@item genmove_white: Generate and play the supposedly best white move.
Returns: a move coordinate or "PASS"
Status: Obsolete GTP version 1 command.
@item genmove: Generate and play the supposedly best move for either color.
Returns: a move coordinate or "PASS" (or "resign" if resignation_allowed)
Status: GTP version 2 standard command.
@item reg_genmove: Generate the supposedly best move for either color.
Returns: a move coordinate (or "PASS")
Status: GTP version 2 standard command.
@item gg_genmove: Generate the supposedly best move for either color.
Arguments: color to move, optionally a random seed
Returns: a move coordinate (or "PASS")
This differs from reg_genmove in the optional random seed.
@cindex restricted_genmove
@item restricted_genmove: 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")
@cindex kgs-genmove_cleanup
@item kgs-genmove_cleanup: Generate and play the supposedly best move for either color, not passing until all dead opponent stones have been removed.
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.
@item level: Set the playing level.
Fails: incorrect argument
@item undo: Undo one move
Fails: If move history is too short.
Status: GTP version 2 standard command.
@item gg-undo: Undo a number of moves
Fails: If move history is too short.
@item time_settings: Set time allowance
Arguments: int main_time, int byo_yomi_time, int byo_yomi_stones
Status: GTP version 2 standard command.
@item time_left: Report remaining time
Arguments: color color, int time, int stones
Status: GTP version 2 standard command.
@item final_score: Compute the score of a finished game.
Arguments: Optional random seed
Returns: Score in SGF format (RE property).
Status: GTP version 2 standard command.
@item final_status: Report the final status of a vertex in a finished game.
Arguments: Vertex, optional random seed
Returns: Status in the form of one of the strings "alive", "dead",
"seki", "white_territory", "black_territory", or "dame".
@cindex final_status_list
@item final_status_list: 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"
@item estimate_score: Estimate the score
Returns: upper and lower bounds for the score
@cindex experimental_score
@item experimental_score: Estimate the score, taking into account which player moves next
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.
@cindex reset_life_node_counter
@item reset_life_node_counter: Reset the count of life nodes.
Note: This function is obsolete and only remains for backwards
@cindex get_life_node_counter
@item get_life_node_counter: Retrieve the count of life nodes.
Returns: number of life nodes
Note: This function is obsolete and only remains for backwards
@cindex reset_owl_node_counter
@item reset_owl_node_counter: Reset the count of owl nodes.
@cindex get_owl_node_counter
@item get_owl_node_counter: Retrieve the count of owl nodes.
Returns: number of owl nodes
@cindex reset_reading_node_counter
@item reset_reading_node_counter: Reset the count of reading nodes.
@cindex get_reading_node_counter
@item get_reading_node_counter: Retrieve the count of reading nodes.
Returns: number of reading nodes
@cindex reset_trymove_counter
@item reset_trymove_counter: Reset the count of trymoves/trykos.
@cindex get_trymove_counter
@item get_trymove_counter: Retrieve the count of trymoves/trykos.
Returns: number of trymoves/trykos
@cindex reset_connection_node_counter
@item reset_connection_node_counter: Reset the count of connection nodes.
@cindex get_connection_node_counter
@item get_connection_node_counter: Retrieve the count of connection nodes.
Returns: number of connection nodes
@item test_eyeshape: Test an eyeshape for inconsistent evaluations
Arguments: Eyeshape vertices
Returns: Failure reports on stderr.
@item analyze_eyegraph: Compute an eyevalue and vital points for an eye graph
Arguments: Eyeshape encoded in string
Fails: Bad eyeshape, analysis failed
Returns: Eyevalue, vital points
@item cputime: Returns elapsed CPU time in seconds.
Returns: Total elapsed (user + system) CPU time in seconds.
@item showboard: Write the position to stdout.
Status: GTP version 2 standard command.
@item dump_stack: Dump stack to stderr.
@cindex initial_influence
@item initial_influence: Return information about the initial influence function.
Arguments: color to move, what information
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_attenuation (float)
black_attenuation (float)
white_permeability (float)
black_permeability (float)
The encoding of influence_regions is as follows:
@item move_influence: Return information about the influence function after a move.
Arguments: move, what information
Returns: Influence data formatted like for initial_influence.
@cindex move_probabilities
@item move_probabilities: 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.
Returns: Move, probabilty pairs, one per row.
@item move_uncertainty: 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.
Returns: bits of uncertainty
@cindex followup_influence
@item followup_influence: Return information about the followup influence after a move.
Arguments: move, what information
Returns: Influence data formatted like for initial_influence.
@item worm_data: Return the information in the worm data structure.
Arguments: optional vertex
Returns: Worm data formatted like:
If an intersection is specified, only data for this one will be returned.
@item worm_stones: List the stones of a worm
Arguments: the location, "BLACK" or "WHITE"
Fails: if called on an empty or off-board location
@item worm_cutstone: Return the cutstone field in the worm data structure.
Arguments: non-empty vertex
@item dragon_data: Return the information in the dragon data structure.
Arguments: optional intersection
Returns: Dragon data formatted in the corresponding way to worm_data.
@item dragon_stones: List the stones of a dragon
Fails: if called on an empty or off-board location
@item eye_data: Return the information in the eye data structure.
Returns: eye data fields and values, one pair per row
@item half_eye_data: Return the information in the half eye data structure.
Returns: half eye data fields and values, one pair per row
@item start_sgftrace: Start storing moves executed during reading in an sgf tree in memory.
Warning: You had better know what you're doing if you try to use this
@item finish_sgftrace: Finish storing moves in an sgf tree and write it to file.
Warning: You had better know what you're doing if you try to use this
@item printsgf: Dump the current position as a static sgf file to filename, or as output if filename is missing or "-"
Arguments: optional filename
Returns: nothing if filename, otherwise the sgf
@cindex tune_move_ordering
@item tune_move_ordering: Tune the parameters for the move ordering in the tactical reading.
Arguments: MOVE_ORDERING_PARAMETERS integers
Fails: incorrect arguments
@item echo: Echo the parameter
@item echo_err: Echo the parameter to stdout AND stderr
@item help: List all known commands
Returns: list of known commands, one per line
Status: GTP version 2 standard command.
@item known_command: Tell whether a command is known.
Returns: "true" if command exists, "false" if not
Status: GTP version 2 standard command.
@cindex report_uncertainty
@item report_uncertainty: Turn uncertainty reports from owl_attack and owl_defend on or off.
@item get_random_seed: Get the random seed
@item set_random_seed: Set the random seed
@cindex advance_random_seed
@item advance_random_seed: Advance the random seed by a number of games.
Returns: New random seed.
@item is_surrounded: 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
@item does_surround: 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)
@item surround_map: 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
@cindex set_search_diamond
@item set_search_diamond: limit search, and establish a search diamond
@cindex reset_search_mask
@item reset_search_mask: unmark the entire board for limited search
@item limit_search: sets the global variable limit_search
@item set_search_limit: mark a vertex for limited search
@item draw_search_area: Draw search area. Writes to stderr.