I have an answer for scoring. It doesn’t involve changing the text of the rules, just careful application of them. It may result in some odd scores for some very artificial board layouts, but since they don’t seem likely to ever turn up in actual gameplay, I’m comfortable with this as a solution. Here’s an example board that poses the question, how do I score this?
Here’s the sentence in the rules that describes how to identify territories: Territory is any region of the board your fences surround that does not contain any territory of your opponent.” So consider how to handle the above. There are two unequivocal territories: the one point blue in the upper right, and the one point red in the lower left. It only makes sense to work out from those, and it’s only fair to do it simultaneously. So at the same time, the one point blue in the upper right precludes the red three-post fence in the upper right from claiming territory, and the one point red in the lower left precludes the long blue fence from claiming territory. So this board is scored correctly as it appears: one point each for red and blue.
In the pathological case:
The one point red in the upper left and the one point blue in the lower right are the starting points. They invalidate the blue fence that starts at 1-9 and the red fence that starts at 7-1. That means that the red fence that starts at 1-8 and the blue fence starting at 5-1 are both valid and make territory. But that in turn means that the blue fence starting at 1-7 and the red fence starting at 3-1 are both invalid. And that means that the red fence starting at 1-6 and the blue fence starting at 1-1 are valid and make territory. And that means that the blue fence starting at 1-5 and the red fence starting at 1-2 are invalid, and finally the red fence starting at 1-4 and the blue fence starting at 1-3 are valid. So each player claims the same amount of territory and prisoners.
Here’s another example:
EDIT: The rule is subtle, and I didn’t apply it correctly here. This is wrong:
The critical point to understand is the lower left corner. Without that, Blue is toast. But Blue’s one point territory there invalidates Red’s fence from 1-3 to 5-1. The same thing happens in the upper right, leading to a score that looks like this:
Blue’s largest territory is worth (26 + 3)^2 = 841 points, while Red’s largest is just 25^2 = 625 points. Each of them have a 1 point territory, but Blue has an additional territory worth 9^2 = 81 points. Blue wins handily. If Red had managed to make territory in the lower left, he would have won easily.
The lower left is critical, as I said, but the upper right is tricky as well. It is bounded by two unequivocal territories: the main Red territory in the center, and the one point Blue in the upper right. Working from each of those in, the Red invalidates the Blue fence from 8-11 to 11-5 at the same time as the Blue invalidates the Red fence from 9-11 to 11-7. The result looks like this:
Blue still wins, but he earns only 1 point in the upper right instead of 81.
I should add that these territories were generated automatically. I have that coded at this point. I now need to get the territories marked for area instead of post scoring, and generate scores automatically.