NAME

Games::AlphaBeta::Reversi - class used with Games::AlphaBeta for playing Reversi

SYNOPSIS

package My::Reversi;
use base Games::AlphaBeta::Reversi;

# Override drawing routine
sub draw { ... }

package main;
use My::Reversi;
use Games::AlphaBeta;

my ($p, $g);
$p = My::Reversi->new;
$g = Games::AlphaBeta->new($p);

while ($g->abmove) {
    $p->draw;
}

DESCRIPTION

METHODS

_init()

Internal method.

Initialize the initial state.

as_string

Return a plain-text representation of the current game position as a string.

valid_move $x, $y

Return true if the given $x/$y coordinate is a valid move for the current player, false otherwise.

findmoves

Return an array of all legal moves at the current position (for the current player).

evaluate

Evaluate a game position.

endpos

Return true if the current position is an end position.

apply $move

Apply a move to the current position, producing the new position.

BUGS

TODO

SEE ALSO

The author's website, describing this and other projects: http://brautaset.org/projects/

AUTHOR

Stig Brautaset, <stig@brautaset.org>

COPYRIGHT AND LICENCE

Copyright (C) 2004 by Stig Brautaset

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.