ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Games-Go-SimpleBoard/SimpleBoard.pm
(Generate patch)

Comparing Games-Go-SimpleBoard/SimpleBoard.pm (file contents):
Revision 1.9 by root, Wed Jun 25 20:11:33 2008 UTC vs.
Revision 1.10 by root, Wed Jun 25 20:49:38 2008 UTC

108 board => [map [(0) x $size], 1 .. $size], 108 board => [map [(0) x $size], 1 .. $size],
109 captures => [0, 0], # captures 109 captures => [0, 0], # captures
110 #timer => [], 110 #timer => [],
111 #score => [], 111 #score => [],
112 @_, 112 @_,
113 unmark => [],
114 }, $class 113 }, $class
115} 114}
116 115
117# inefficient and primitive, I hear you say? 116# inefficient and primitive, I hear you say?
118# well... you are right :) 117# well... you are right :)
220 219
221 for (@$path) { 220 for (@$path) {
222 my ($x, $y, $clr, $set, $label) = @$_; 221 my ($x, $y, $clr, $set, $label) = @$_;
223 222
224 if (!defined $x) { 223 if (!defined $x) {
224 $$_ &= ~$mark_symbols for @{ delete $self->{unmark} || [] };
225 # pass 225 # pass
226 226
227 } elsif ($x == MOVE_HANDICAP) { 227 } elsif ($x == MOVE_HANDICAP) {
228 $$_ &= ~$mark_symbols for @{ delete $self->{unmark} || [] };
229
228 # $y = #handicap stones 230 # $y = #handicap stones
229 my $c = $HANDICAP_COORD{$self->{size}} 231 my $c = $HANDICAP_COORD{$self->{size}}
230 or Carp::croak "$self->{size}: illegal board size for handicap"; 232 or Carp::croak "$self->{size}: illegal board size for handicap";
231 my $h = $HANDICAP_XY{$y} 233 my $h = $HANDICAP_XY{$y}
232 or Carp::croak "$y: illegal number of handicap stones"; 234 or Carp::croak "$y: illegal number of handicap stones";
242 $$space = $$space & ~$clr | $set; 244 $$space = $$space & ~$clr | $set;
243 245
244 $self->{label}[$x][$y] = $label if $set & MARK_LABEL; 246 $self->{label}[$x][$y] = $label if $set & MARK_LABEL;
245 247
246 if ($set & MARK_MOVE) { 248 if ($set & MARK_MOVE) {
247 $$_ &= ~$mark_symbols for @{ $self->{unmark} }; 249 $$_ &= ~$mark_symbols for @{ $self->{unmark} || [] };
248 @{ $self->{unmark} } = $space; 250 @{ $self->{unmark} } = $space;
249 251
250 unless (${ $_->[5] ||= \my $hint }) { 252 unless (${ $_->[5] ||= \my $hint }) {
251 my ($own, $opp) = 253 my ($own, $opp) =
252 $set & MARK_B 254 $set & MARK_B

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines