May 20, 2010 18:27
If anyone doesn't know what the Moore neighbourhood is: it's the eight squares surrounding any square of a square grid.
I admit it, I'm feeling lazy. I could do it myself, with a bit of head-scratching, no doubt. But it's a nice little problem, particularly if you're au fait with a programming language that supports automatic backtracking, such as Prolog or Icon...
Find (and, for extra credit, display prettily!) all the distinct (i.e., disregarding rotations and reflections) populations of the Moore neighbourhood of a square for a two-state (black/white) cellular automaton.