I'm trying to determine which discs of an Othello board are stable ones (those that can't be flipped for the rest of the game).
I've read that the disc needs to be stable in all four directions (horizontally, vertically and both diagonals). For it to be stable in any direction, either the direction is full of discs so that no more can be placed in that direction, it is on the edge of the board, or it is adjacent to a stable disc of the same color.
I understand the first two parts, but is there a specific order in which I need to evaluate the stability of discs, because there could be a chain reaction that induces stability.
I don't think there is explicit algorithm (short-cut) to solve it.
If you don't mind caching, brute force can solve your problem easily.
Brute force = solving case by case.
At first, I has a board with some discs placed (2+2 disc), the first player can place black disc at
{i1,i2,i3,...}
.If the first player pick
i1
, the second player can pick one of location{i11,i12,i13,...}
to place white disc.If the second player pick
i11
, the first player can pick one of location{i111,i112,i113,...}
to place black disc.... and so on.
It is not much (at most 64-4 steps).
Do it as a batch! .... leave your computer alone (for a few hours, may be).
Finally you would get a complete database.
It seems to be a fun task to code.
After you see the report, you may notice possibility of a better algorithm.