I am currently writing some code to deal with Go boards. A Go board is represented as an array of colors. The array has size
× size
entries and represents a two-dimensional square board.
enum color {
EMPTY,
BLACK,
WHITE,
};
struct go_board {
unsigned int size;
enum color intersections[];
};
When enum color player
moves, the following procedure applies: (See rules)
I am looking for a fast (in terms of noth computational complexity and actual speed) algorithm to clear a board. Can you help me?
Use image processing's flood-filling algorithms. First, seed with the empty points and fill all positions that are white or empty; all non-filled positions with white stones will be dead. Repeat with black.