[Community Puzzle] Go competition

Continuing the discussion from [Community Puzzle] Go competition:

“Test - Basics 3” => this testcase is looking for an incorrect answer. The testcase thinks that BLACK should be at 22, but the actual answer is 36. Below is the correct answer:

BLACK : 36
WHITE : 42.5
WHITE WINS

Black has 13 stones + 9 intersections in its territory → 22 points.
White has 26.5 points with the komi.

The middle area is neutral, it belongs to no one.

As input, I see 9 rows, 9 columns. After running, black has 4 stones in each row and white has 4, with the middle column neutral. I’m wondering if I’m seeing a different input than you?

Below is what I see for input, and also after running the program:

input:
.B…W.
B.B…W.W
.B…W.
B.B…W.W
.B…W.
B.B…W.W
.B…W.
B.B…W.W
.B…W.

output:
BBBB.WWWW
BBBB.WWWW
BBBB.WWWW
BBBB.WWWW
BBBB.WWWW
BBBB.WWWW
BBBB.WWWW
BBBB.WWWW
BBBB.WWWW

I’m wondering if you ran it long ago and more recently this testcase changed?

You didn’t understand the rules properly.
For you, an intersection belongs to black if it’s closer to black than to white.
It’s not the rule.
The rule is: an intersection belongs to black if it’s surrounded by black.
So, as I said above, all central intersections are neutral.

1 Like

Thanks, now I understand. My code (neutral squares are the squares equidistant from both colors) worked for all the other testcases but only failed for the third testcase. I’m surprised other players didn’t interpret this incorrectly as well, but I have never played GO. :wink: