Games-Go-Image2SGF

 view release on metacpan or  search on metacpan

Image2SGF.pm  view on Meta::CPAN

344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
    my $time = scalar localtime;
    $self->{sgf} .= <<ENDSTARTSGF;
(;GM[1]FF[4]SZ[19]
GN[Image2SGF conversion of $time.]
 
AP[Image2SGF by Chris Ball.]
PL[B]
ENDSTARTSGF
}
 
sub update_sgf {
   my $self = shift;
   my ($stone, $x, $y) = @_;
   if ($stone == BLACK) {
       push @{$self->{blackstones}}, "$y$x";
   }
   elsif ($stone == WHITE) {
       push @{$self->{whitestones}}, "$y$x";
   }
}



( run in 1.359 second using v1.01-cache-2.11-cpan-49f99fa48dc )