grandmaster / master README

Tree @master (Download .tar.gz)

README @masterraw · history · blame

grandmaster is a lazy enumerator of the chess game tree.

This can be more useful than it sounds. The goal for the grandmaster project is
to be used to store the state of many games at once and allow for easy analysis
of these games. It stores games as pointers into the chess game tree, lazily
adding nodes to the tree as needed. In a sense, it is the git branching
model but for chess games. This allows for easy rewinding or forking off of
games, or speculative explorations of many branches of the game. It may also be
useful for chess engines, although having never implemented a chess engine I
can't be sure.

grandmaster is split into two sections: "core" and "gm". The core is the
encoding of chess logic in C; this could easily be used by other chess engines
or game clients to represent chess game state. The core is built as a static
library; to only build core, run "make dist/libgrandmaster.a". If you want to
use core in your own chess application, copy libgrandmaster.a to somewhere on
your library path and copy include/grandmaster to somewhere on your include
path. Note that the core static library only contains definitions for the
objects defined in include/grandmaster/core.h; the other headers define objects
that may or may not be in other binaries or librarys.

gm (built by running "make dist/gm") is the tool used as both client and server
for the grandmaster protocol; a single binary is generated with a command line
flag that switches it between server mode and client mode. Server mode accepts
the grandmaster protocol defined in PROTOCOL and keeps game state in memory.
The client takes JSON on stdin and length-encodes it as required by the
grandmaster protocol, and exists almost entirely as a testing tool. A real
client library (probably for a scripting language of some sort) is forthcoming.

There are some tests in the test directory; you can run them using "make test".
All of these tests are tests against grandmaster core. Tests for gm are

grandmaster is distributed under the GNU GPLv2. You can find the full text of
this license in the LICENSE file in this repository.