The example scripts

The following example scripts are available in the gomill_examples/ directory of the Gomill source distribution.

Some of them may be independently useful, as well as illustrating the library API.

See the top of each script for further information.

See running the example scripts for notes on making the gomill package available for use with the example scripts.

show_sgf.py

Prints an ASCII diagram of the position from an SGF file.

This demonstrates the sgf, sgf_moves, and ascii_boards modules.

split_sgf_collection.py

Splits a file containing an SGF game collection into multiple files.

This demonstrates the parsing functions from the sgf_grammar module.

twogtp

A ‘traditional’ twogtp implementation.

This demonstrates the gtp_games module.

find_forfeits.py

Finds the forfeited games from a playoff or all-play-all tournament.

This demonstrates the tournament results API.

gtp_test_player

A GTP engine intended for testing GTP controllers.

This demonstrates the low-level engine-side GTP code (the gtp_engine module).

gtp_stateful_player

A GTP engine which maintains the board position.

This demonstrates the gtp_states module, which can be used to make a GTP engine from a stateless move-generating program, or to add commands like undo and loadsgf to an engine which doesn’t natively support them.

kgs_proxy.py

A GTP engine proxy intended for use with kgsGtp. This produces game records including the engine’s commentary, if the engine supports gomill-savesgf.

This demonstrates the gtp_proxy module, and may be independently useful.

mogo_wrapper.py

A GTP engine proxy intended for use with Mogo. This can be used to run Mogo with a GTP controller (eg Quarry) which doesn’t get on with Mogo’s GTP implementation.

This demonstrates the gtp_proxy module, and may be independently useful.

gomill-clop

An experimental script for using Gomill as a back end for Rémi Coulom’s CLOP optimisation system. It has been tested with CLOP-0.0.8, which can be downloaded from http://remi.coulom.free.fr/CLOP/ .

To use it, write a control file based on clop_example.ctl in the gomill_examples/ directory, and run

$ gomill-clop <control file> setup

That will create a .clop file in the same directory as the control file, which you can then run using clop-gui.