Games::SGF::Go - A Go Specific SGF Parser
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-> ][ $move-> ] = '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.
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.
The method will return true if the move was a pass.
This is represented in the SGF as an empty string:
$move = $sgf->pass;
This will return a $move which is a pass.
<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
You can find documentation for this module with the perldoc command.
You can also look for information at:
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. .