NAME

Games::Sequential - framework for sequential games with object oriented interface

SYNOPSIS

use Games::Sequential;
my $game = Games::Sequential->new( initialpos => $p, move => \&move );

$game->debug(1);

$game->move($move);
$game->undo;

DESCRIPTION

Games::Sequential provides a simple base class for sequential games. The module provides an undo mechanism, as it keeps track of the history of moves, in addition to methods to clone a game state with or without history.

Users will have to provide this module with a reference to a callback function to perform a move in the game they are implementing. This callback is:

move $position, $move

Create $newpos as copy of $position and apply $move to it. Return $newpos.

METHODS

Users must not modify the referred-to values of references returned by any of the below methods, except, of course, indirectly using the supplied callbacks mentioned above.

new [@list]

Create and return a new AlphaBeta object.

The function move can be given as an argument to this function. If so, there is no need to call the setfuncs() method. Similarly, if a valid starting position is given (as initialpos) there is no need to call init() on the returned object.

The arguments ply & debug can also optionally be set here. They can later be changed with their respective accessor methods.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 51:

=over without closing =back

Around line 85:

'=end' without a target? (Should be "=end internal")