From baf11e9ad7ac586c412889c83e43d74a465b5135 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Mon, 3 Jun 2024 05:06:40 -0600 Subject: [PATCH] Fix overzealous marking of dame --- src/autoscore.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/autoscore.ts b/src/autoscore.ts index 087c6cb2..17e9c86f 100644 --- a/src/autoscore.ts +++ b/src/autoscore.ts @@ -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]) @@ -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"); - } } }