Games::SGF::Go - A Go Specific SGF Parser


Games-SGF documentation  | view source Contained in the Games-SGF distribution.

Index


NAME

Top

Games::SGF::Go - A Go Specific SGF Parser

VERSION

Top

Version 0.993

SYNOPSIS

Top

  use Games::SGF::Go;

  my $sgf = new Games::SGF::Go;

  $sgf->readFile('somegame.sgf');

  # fetch Properties
  my $komi = $sgf->property('KM');
  my $handicap = $sgf->property('HA');

  # move to next node
  $sgf->next;

  # get a move
  my $move = $sgf->property('B');

  # add it to a board

  $board[ $move->[0] ][ $move->[1] ] = 'B';

DISCRIPTION

Top

Games::SGF::Go Extends Games::SGF for the game specifics of Go. These include adding the tags 'TB', 'TW', 'HA', and 'KM'. It will also parse and check the stone, move, and point types.

The stone, move and point types will be returned as an array ref containing the position on the board.

You can set application specific tags using setTag in Games::SGF. All the callbacks to Games::SGF have been set and thus can't be reset.

All other methods from METHODS in Games::SGF can be used as you normally would.

METHODS

Top

new

  my $sgf = new Games::SGF::Go;

This will create the Games::SGF::Go object.

point

stone

move

  $struct = $self->move(@cord);
  @cord = $self->move($struct);

If a point, stone, or move is passed in, it will be broken into it's parts and returned. If the parts are passed in it will construct the internal structure which the parser uses.

These override point in Games::SGF, stone in Games::SGF, and move in Games::SGF.

isPass

   $sgf->isPass($move);

The method will return true if the move was a pass.

This is represented in the SGF as an empty string:

  ;B[];W[]

pass

   $move = $sgf->pass;

This will return a $move which is a pass.

ALSO SEE

Top

Games::SGF

http://www.red-bean.com/sgf/go.html

AUTHOR

Top

David Whitcomb, <whitcode at gmail.com>

BUGS

Top

Please report any bugs or feature requests to bug-games-sgf at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Games-SGF. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Games::SGF::Go




You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Games-SGF

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Games-SGF

* CPAN Ratings

http://cpanratings.perl.org/d/Games-SGF

* Search CPAN

http://search.cpan.org/dist/Games-SGF

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Games-SGF documentation  | view source Contained in the Games-SGF distribution.