示例#1
0
 public Cube(Cube cube)
     : this()
 {
     Array.Copy(cube.edges, edges, EDGE_COUNT);
 }
示例#2
0
 static void GenerateCubes(int edgeIndex)
 {
     if (edgeIndex == Cube.EDGE_COUNT)
     {
         Cube cube = new Cube(currentEdges);
         if (isomorphicCubes.Contains(cube))
         {
             return;
         }
         for (int i = 0; i < 4; i++)
         {
             cube.RotateXY();
             for (int j = 0; j < 4; j++)
             {
                 cube.RotateXZ();
                 for (int k = 0; k < 4; k++)
                 {
                     cube.RotateYZ();
                     isomorphicCubes.Add(new Cube(cube));
                 }
             }
         }
         cubesCount++;
         //Console.WriteLine(cube);
         return;
     }
     for (int color = 1; color <= Cube.MAX_COLOR; color++)
     {
         if (colorsLeftCount[color] > 0)
         {
             colorsLeftCount[color]--;
             currentEdges[edgeIndex] = color;
             GenerateCubes(edgeIndex + 1);
             colorsLeftCount[color]++;
         }
     }
 }