The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Games::Go::GTP - Interact with a server or Go playing program using GTP

SYNOPSIS

  use Games::Go::GTP;
  use Player;
  my $referee = new Games::Go::Referee;
  my $player = new Player;
  ...
  my ($res, $status) = Games::Go::GTP::gtpcommand(@args, $referee, $player);

DESCRIPTION

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

General use

  An example of a script to run a bot on KGS is given in the example folder.