Games::SGF::Go - A Go Specific SGF Parser
Version 0.993
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';
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.
my $sgf = new Games::SGF::Go;
This will create the Games::SGF::Go object.
$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.
$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[]
$move = $sgf->pass;
This will return a $move which is a pass.
Games::SGF
http://www.red-bean.com/sgf/go.html
David Whitcomb, <whitcode at gmail.com>
<whitcode at gmail.com>
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
bug-games-sgf at rt.cpan.org
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
Copyright 2008 David Whitcomb, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .
To install Games::SGF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::SGF
CPAN shell
perl -MCPAN -e shell install Games::SGF
For more information on module installation, please visit the detailed CPAN module installation guide.