If the wheel color data is stored like this:
Code:
#define NUM_WHEELS 7
#define NUM_COLORS 6
enum {Black, Red, White, Blue, Yellow, Green};
int wheels[NUM_WHEELS][NUM_COLORS] = {
{ Black, Red, White, Blue, Yellow, Green },
{ Yellow, Blue, Red, Black, White, Green },
{ Blue, Yellow, Red, White, Green, Black },
{ Green, Blue, Yellow, Red, White, Black },
{ Green, Red, White, Blue, Black, Yellow },
{ Red, Green, Yellow, Black, Blue, White },
{ Yellow, White, Blue, Green, Red, Black }
};
And you number the positions of the wheels like this:
Code:
* * * *
* 1 * * 2 *
* * * *
* * * * * *
* 6 * * 0 * * 3 *
* * * * * *
* * * *
* 5 * * 4 *
* * * *
And you number the orientation of a wheel such that the color in the upper left gives the orientation number.
E.g, wheel number 0 in wheels array above: Black, Red, White, Blue, Yellow, Green
If Black is in the upper left position, then it is in orientation 0. If Red is in that position then it's orientation 1. Etc.
Then with a position and orientation array like this:
Code:
struct {
int wheel;
int orientation;
} positions[NUM_WHEELS];
You could go through all possibilities.
There's quite a few, but only about two hundred million.
7*6*5*4*3*2*1 = 5040
6**6 = 46656 (you can assume center wheel is always in orientation 0)
5040 * 46656 = 235,146,240
I was able to get the following solution:
Code:
W K R W
R G G B
Y B Y K
G Y B Y K W
R K K R R G
W B G W B Y
B G W B
W R R Y
Y K K G