When a game ends, score all 256 cells, including occupied cells and empty cells
where placement is forbidden. Each cell is worth at most 1 point.
Distance layers
Measure the straight-line (Euclidean) distance from the cell being scored to each stone.
Stones at the same distance form a distance layer.
- dr is the difference between the row of the cell being scored and the row of a stone.
- dc is the difference between the column of the cell being scored and the column of that stone.
You can compare squared distances exactly using dr * dr +
dc * dc. This gives the same distance order without square roots.
Who receives the point?
- Inspect the distance layers from nearest to farthest.
- In the current layer, count the Black stones and the White stones.
- If one color has more stones, that color receives 1 point for the cell. Stop scoring this cell.
- If the counts are equal, ignore that layer and inspect the next one. Do not carry its counts forward.
- If every layer is tied, the cell is unclaimed and neither color receives a point.
An occupied cell belongs to its own stone's color, because that stone is at distance 0.
Example: the nearest layer contains 1 Black stone and
1 White stone. Skip that layer. If the next layer contains 2
Black stones and 1 White stone, Black receives 1 point.

Combined match score
Each player's match score is the sum of their territory points from both games,
following their own color on each board. Compare this total; individual game wins do not decide the match.
Example: player 0 scores 130 against 126
in game 1, then 120 against 136 in game 2.
The combined scores are 250 against 262, so player 1
wins the match even though each player won one game.
