[Contents]   [Back]   [Prev]   [Up]   [Next]   [Forward]  


Using GNU Go

Installation

In short, ./configure; make will build GNU Go; optionally (running as root) make install will put it into `/usr/local/bin' and also install the man page. You also will probably want to install CGoban.

Get the most recent tar file from ftp.gnu.org or a mirror. A list of mirrors may be found at:

http://www.gnu.org/order/ftp.html

Untar the sources, change to the directory `gnugo-2.6/'. Now do:

  ./configure
  make

This makes a binary called `interface/gnugo'. Now (running as root) type

  make install

This will install gnugo in `/usr/local/bin/', and also install the man page `gnugo.6' into `/usr/man/man6/'.

There are two methods of using GNU Go. You may run it from the command line by just typing gnugo, but it is nicer to run it under X-Windows using CGoban.

Obtain the most recent version of CGoban from Bill Shubert's web site:

http://www.inetarena.com/~wms/comp/cgoban

The CGoban version number MUST be 1.9.1 at least or it won't work. Instructions for using CGoban are elsewhere in this document see section Running GNU Go via CGoban.

Problems

On one GNU/Linux machine an incompatible `/usr/include/curses.h' (from BSD) had declarations inconsistent with those in `/usr/include/term.h'. The symptom of this problem is compilation errors in `engine/moyo.c' and `engine/showbord.c'.

In this case, the correct `curses.h' was found in `/usr/include/ncurses' and a correct compilation was obtained after changing

  #include <curses.h>

to

  #include <ncurses/curses.h>

in `engine/moyo.c' and `engine/showbord.c'. If you have a problem with errors in `engine/moyo.c' and `engine/showbord.c' caused by curses you should try such a remedy first. If this doesn't work, you shouldn't curse. Run configure --disable-color to turn off the color option and compile again. Another alternative if you want color is configure --without-curses --enable-color. This will substitute ansi escape sequences for curses.

Documentation

Documentation in `doc/' consists of a man page `gnugo.6', the info files `gnugo.info', `gnugo.info-1', ... and the Texinfo files from which the info files are built. The Texinfo documentation contains this User's Guide and extensive information about the algorithms of GNU Go, for developers.

If you want a typeset copy of the Texinfo documentation, you can make gnugo.dvi or make gnugo.ps in the `doc/' directory.

You can make an HTML version with the command makeinfo --html gnugo.texi. Better HTML documentation may be obtained using texi2html -split_chapter gnugo.html. You can obtain the texi2html utility from http://www.mathematik.uni-kl.de/~obachman/Texi2html/. (See also http://texinfo.org/texi2html/.) Unfortunately Version 1.58 of texi2html does not support the @option and @command tags. These are supported in Version 1.60-Beta. However our current recommendation is to use Version 1.58, and to add the lines

	      'command', 'CODE',
	      'option', 'SAMP',

to the style_map around line 178 of the perl script.

User documentation can be obtained by running gnugo --help or man gnugo from any terminal, or from the Texinfo documentation.

Documentation for developers is in the Texinfo documentation, and in comments throughout the source. Contact us at gnugo@gnu.org if you are interested in helping to develop this program.

Running GNU Go via CGoban

This is an extremely nice way to run GNU Go. CGoban provides a beautiful graphic user interface under X-Windows.

Start CGoban. When the CGoban Control panel comes up, select "Go Modem". You will get the Go Modem Protocol Setup. Choose one (or both) of the players to be "Program," and fill out the box with the path to gnugo. After clicking OK, you get the Game Setup window. Choose "Rules Set" to be Japanese (otherwise handicaps won't work). Set the board size and handicap if you want. Click OK and you are ready to go.

In the Go Modem Protocol Setup window, when you specify the path to GNU Go, you can give it command line options, such as --quiet to suppress most messages. Since the Go Modem Protocol preempts standard I/O other messages are sent to stderr, even if they are not error messages. These will appear in the terminal from which you started CGoban.

Other command line options can be listed by typing gnugo --help -or- man gnugo from any terminal.

Ascii Interface

Even if you do not have CGoban installed you can play with GNU Go using its default Ascii interface. Simply type gnugo at the command line, and GNU Go will draw a board. Typing help will give a list of options. At the end of the game, pass twice, and GNU Go will prompt you through the counting. You and GNU Go must agree on the dead groups--you can toggle the status of groups to be removed, and when you are done, GNU Go will report the score.

GNU Go mode in Emacs

You can run GNU Go from Emacs. This has the advantage that you place the stones using the cursor arrow keys. This may require Emacs 20.4 or later--it has been tested with Emacs 20.4 but does not work with Emacs 19 or Emacs 20.2.

Load `interface/gnugo.el', either by M-x load-file, or by copying the file into your `site-lisp' directory and adding a line

(autoload 'gnugo "gnugo" "GNU Go" t)

in your `.emacs' file.

Now you may start GNU Go by M-x gnugo. You will be prompted for command line options see section Invoking GNU Go: Command line options. Using these, you may set the handicap, board size, color and komi.

You can enter commands from the GNU Go ASCII interface after typing `:'. For example, to take a move back, type `:back', or to list all commands, type `:help'.

Here are the default keybindings:

Running GNU Go via Jago

Jago, like CGoban is a client capable of providing GNU Go with a graphical user interface. Unlike CGoban, it does not require X-Windows, so it is an attractive alternative under Windows. You will need a Java runtime environment. Obtain Jago at

http://mathsrv.ku-eichstaett.de/MGF/homes/grothmann/jago/Go.html

and follow the links there for the Java runtime environment.

Go Modem Protocol

The Go Modem Protocol (GMP) was developed by Bruce Wilcox with input from David Fotland, Anders Kierulf and others, according to the history in

ftp://www.joy.ne.jp/welcome/igs/Go/programs/protocol.Z

Any Go program should use this protocol since it is standard. Since CGoban supports this protocol, the user interface for any Go program can be done entirely through CGoban. The programmer can concentrate on the real issues without worrying about drawing stones, resizing the board and other distracting issues.

Smart Go Format

The Smart Go Format (SGF), is the standard format for storing Go games. GNU Go supports both reading and writing SGF files. The SGF specification (FF[4]) is at:

http://www.red-bean.com/sgf/

Invoking GNU Go: Command line options

Some basic options

Options affecting strength and speed

Ascii mode options:

Development options:

Using --analyze:

The analyze options allow analysis of a game stored as sgf file by using --testmode. When using --testmode with --analyze move tree variations are ignored.

The --analyze option also works with --benchmark and --score. The analyze functions will be executed on every move in --benchmark and --testmode game.

If used with --analyzerfile filename, the results of the analysis are written to the file filename.

Analyzed board states on other modes:

--score end: gnugo analyzes every move it makes at the end of the file until the game is finished.

--score last: board state at the end of the file will be analyzed

--score move number: board state just before movenum will be analyzed

--score position: board state just before position is occupied will be analyzed

--testmode annotation: board state just before the annotated node is reached will be analyzed

description of --analyze options:

You can give more than one --analyze option also by concatenating with "" or by using commas without space.

Usage examples:

gnugo --score end --analyzerfile outputfile -l inputfile

will create outputfile and writes the inputfile to it plus the endgame moves for scoring and adds the result property. If you want to overwrite an already existing result property use --analyze overwrite. This also overwrites DT, AP and RU.

gnugo --score end --analyzerfile outputfile -l inputfile \
          --analyze dragonstatus

same as above, but writes to outputfile the dragonstatus for every move gnugo made from the last move in inputfile to the end of the game.

gnugo --testmode game --analyzerfile outputfile -l inputfile \
         --analyze wormliberties

loads inputfile and writes to outputfile the number of liberties for each worm on every move.

gnugo --testmode annotation --analyzerfile outputfile -l inputfile \ 
          --analyze capture

loads inputfile and writes to outputfile the capturing move for each weak group on every move followed by a annotation (see section Regression testing)


[Contents]   [Back]   [Prev]   [Up]   [Next]   [Forward]