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.14 by elmex, Thu Jul 24 08:58:02 2008 UTC vs.
Revision 1.15 by elmex, Thu Jul 24 09:14:12 2008 UTC

252 252
253 if ($set & MARK_MOVE) { 253 if ($set & MARK_MOVE) {
254 $$_ &= ~$mark_symbols for @{ $self->{unmark} || [] }; 254 $$_ &= ~$mark_symbols for @{ $self->{unmark} || [] };
255 @{ $self->{unmark} } = $space; 255 @{ $self->{unmark} } = $space;
256 256
257 # remark the space, in case the move was on the same spot as the
258 # old mark
259 $$space |= $set;
260
257 unless (${ $_->[5] ||= \my $hint }) { 261 unless (${ $_->[5] ||= \my $hint }) {
258 my ($own, $opp) = 262 my ($own, $opp) =
259 $set & MARK_B 263 $set & MARK_B
260 ? (MARK_B, MARK_W) 264 ? (MARK_B, MARK_W)
261 : (MARK_W, MARK_B); 265 : (MARK_W, MARK_B);
280 ${ $_->[5] } ||= !(@capture || @suicide); 284 ${ $_->[5] } ||= !(@capture || @suicide);
281 285
282 if (@suicide) { 286 if (@suicide) {
283 $self->{board}[$_->[0]][$_->[1]] = 0 287 $self->{board}[$_->[0]][$_->[1]] = 0
284 for @suicide; 288 for @suicide;
289 # count suicides as other sides stones
290 $self->{captures}[$opp == MARK_B ? COLOUR_BLACK : COLOUR_WHITE] += @suicide;
285 291
286 } elsif (!@suicide && @capture == 1) { 292 } elsif (!@suicide && @capture == 1) {
287 # possible ko. now check liberties on placed stone 293 # possible ko. now check liberties on placed stone
288 294
289 my $libs; 295 my $libs;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines