Yesterday I made the basic Go board. Today I tried my hand at making a board that automatically cleans up after a battle.
For those of you who don’t know, the basic idea of Go is to amass territory by strategically placing stones so that they surround your opponent’s stones. When groups of stones are completely surrounded — cut off from any empty spaces that would let them “breathe” — then those stones die, and are removed from the board.
My programming task today was to figure out when a group of stones has died, and then automatically remove them from the board.
Just for fun, I’ve turned this into a little puzzle. When you click on the image below, a page will pop up containing a Go board. Your task is to click twice: Your first click should add a black stone that finishes surrounding a group of white stones. Your second click should add a white stone that finishes surrounding a group of white stones.
If you get it right, then after each click a group of surrounded stones will automatically disappear from the board.