GGTL-Nim - GGTL extension for a simple Nim variant
#include <ggtl/nim.h> GGTL *g = ggtl_new_nim(); struct nim_state *s = ...; nim_init(g, s);
This is a minimal GGTL extension used mainly in GGTL's test suite.
Initialises a GGTL's vtable with functions for playing
Nim, and set the provided state to be the starting state of the
game.
Return a new state with player and value set to the given arguments, or NULL on error.
Return a new nim move, or NULL on error.
Returns the fitness of a gamestate from the view of the current player. A non-ending state has a fitness of 0, a finishing state has a fitness of 1. It is a winning state for that player, as the previous player was forced to take the last piece.
Returns the state resulting from applying move to state, or
NULL on failure.
Returns the state resulting from reversing move on state, or
NULL on failure.
Returns a list of the available moves at the given position, or NULL if no moves could be found.
Stig Brautaset <stig@brautaset.org>
Copyright (C) 2005-2006 Stig Brautaset
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.