Skip to content

Commit

Permalink
Fix overzealous marking of dame
Browse files Browse the repository at this point in the history
  • Loading branch information
anoek committed Jun 3, 2024
1 parent a5ecb78 commit baf11e9
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/autoscore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,13 @@ export function autoscore(
isBlack(white_plays_first_ownership[y][x])
) {
remove(x, y, "both players agree this is captured by black");
}

if (
} else if (
board[y][x] === JGOFNumericPlayerColor.BLACK &&
isWhite(black_plays_first_ownership[y][x]) &&
isWhite(white_plays_first_ownership[y][x])
) {
remove(x, y, "both players agree this is captured by white");
}

if (
} else if (
board[y][x] === JGOFNumericPlayerColor.EMPTY &&
isDameOrUnknown(black_plays_first_ownership[y][x]) &&
isDameOrUnknown(white_plays_first_ownership[y][x])
Expand Down Expand Up @@ -236,15 +232,6 @@ export function autoscore(
is_settled[y][x] = 1;
settled[y][x] = JGOFNumericPlayerColor.BLACK;
}

if (
isDameOrUnknown(black_plays_first_ownership[y][x]) &&
isDameOrUnknown(white_plays_first_ownership[y][x])
) {
is_settled[y][x] = 1;
settled[y][x] = JGOFNumericPlayerColor.EMPTY;
remove(x, y, "both players agree this is dame");
}
}
}

Expand Down

0 comments on commit baf11e9

Please sign in to comment.