Description Usage Arguments Details Value See Also
gogame class object capusulizes a go game record.
It keeps stores such game plays, outcomes as well as
other information such as player names and date.
The object supports various methods for creating board images and
Kifu documents.
1 | gogame(properties, gametree)
|
properties |
a list of game properties |
gametree |
a list |
This is a constructor of gogame class object.
It is mainly designed to be called from parse_sgf function,
which interprets text of sgf format and creates the corresponding
gogame object.
The object can produce two kinds of game images.
The first is a board snapshot at an arbitrary timing.
stateat is for computing the board configuration and
plotat is for drawing the board image.
The second kind of images is the kifu document that summarize a range of
moves in a page.
kifu is prepared for computing the move sequence and
kifuplot is for drawing the image.
The constructor takes two mandatory arguments: properties and gametree.
properties is a named list of game meta information.
Currently, following names are recognized (variable type in parentheses).
One may provide additional information so long as it does not contradict
names of other information. Check str(mimiaka) to see a list of
variable names already in use.
boardsizeboard size (integer
whitename, whiterank, blackname, blackrankplayer
names and ranks (character)
komiKomi (numeric)
handicapnumber of handicap stones (integer)
resultgame outcome (character)
date, placegame date and location (character)
event, roundcompetition or event name and round (character)
rulerule (character)
gametree stores game plays, setups, comments, and territory counts.
To accomodate the cases of games with branches, the object employs a tree
data structure.
gametree should contain potentially four data sets.
Parentheses list the variable names to be contained.
transitionTransition of board configuration.
a positive value means a stone is added, negative means removed.
Absolute values of value indicate the stone color (1: black, 2: white)
(x, y, value, move, nodeid)
moveMoves and setups. ismove indicates whether it is a
move or setup (x, y, color, ismove, move, nodeid)
pointTerritories.
(x, y, color, move, nodeid)
commentComments made during the game.
(comment, move, nodeid)
nodeid variable in each data indicates the tree node to which the row belongs to.
gametree also include three variables that describe tree structure.
parentinteger vector that points parent of each node. The first node is always assumed to be the root node and its parent is zero
childrenlist of integer vector that points children of each node
leafinteger vector of leaf nodes (i.e. no children)
For example, when there is only one node, nodeid variable of all data should be 1,
and parent is 0 (there is only the root node), children has unique entry
and it is integer vector of length zero, and leaf is 1.
When some of the three components are missing, then the function tries the best to
recover from the supplied information
When transition is missing, then the function tries to compute it using
move and tree structure information.
gogame object
read_sgf, parse_sgf,
plotat, stateat, kifu, kifuplot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.