Hi all.

I've been wracking my brain trying to find a simple solution to this problem, but everything I come up with seems overly complicated.

I have a 2x2x2 array where each cell can be on or off. This yields 256 possible states for the array. The problem I'm having is finding a way to detect a specific set of configurations - including their multiple possible orientations AND mirrored versions - without having to resort to creating a look up table. There are no requirements that disallow a simple look up table to determine which configuration the cells are in, except that I'd rather have a solution that could be expanded to larger arrays.

The closest to a solution I've devised thus far involves counting how many adjacent cells (eg: 0, 0, 0 - 1, 0, 0), diagonal cells (0, 0, 0 - 1, 1, 0) and opposing cells (0, 0, 0 - 1, 1, 1) there are, and comparing those numbers to the numbers involved in each configuration. This overcomes checking for various orientations and mirrored versions of specific cell configurations, but requires that cells are all manually inspected and compared against other cells, which seems unavoidable, but I keep getting this nagging feeling that I could somehow represent the array in a way that allows for an XOR or two against template configurations to count these relationships more quickly.

This is a very abstract problem without a clear and concise method of solving it. I've tried looking at it from many different angles and have exhausted myself for the time being. I'm merely seeking any insight anybody may have about an effective and efficient solution beyond what I have come up with on my own so far.

Thanks.