Games::Go::GTP - Interact with a server or Go playing program using GTP
use Games::Go::GTP; use Games::Go::Player; my $referee = new Games::Go::Referee; my $player = new Games::Go::Player; ... my ($res, $status) = Games::Go::GTP::gtpcommand(@args, $referee, $player);
I would like to make this module more abstract, but I'm not sure how. For example, it assumes that Player, which is the code that generates a move (supply your own!), supports the following methods:
$player->size($somesize); # eg, $player->size(19), issued following the GTP command boardsize $player->initboard($referee); # following the GTP command clear_board $player->update($colour, $referee); # following GTP play $player->chooselegalmove($colour, $referee); # following GTP genmove $player->{_KGScleanup} = 1; # following the KGS specific kgs_genmove_cleanup
An example of a script to run a bot on KGS is given in the example folder.
use Games::Go::GTP; Games::Go::GTP::engineName('MYNAME'); # set MYNAME to anything you like Games::Go::GTP::engineVersion('0.01'); # set '0.01' to anything you like Games::Go::GTP::protocolVersion('2'); # leave this one alone ?
DG
To install Games::Go::GTP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Go::GTP
CPAN shell
perl -MCPAN -e shell install Games::Go::GTP
For more information on module installation, please visit the detailed CPAN module installation guide.