public static void setcube(Cube c, int index, int symtype) { int tg = (index % 594); index = index / 594; int e = (index % 2048); index = index / 2048; int d = index; c.SetCornerTwistFromIndex(symGroupMembers[tg][symtype]); c.SetEdgeFlipFromIndex(symEdgeFlipIndex[e][symtype]); c.SetMiddleEdgeDistributionFromIndex(symMiddleEdgeDistributionIndex[d][symtype]); }
private static void BuildTwistSymGroup() { twistSymGroup = new int[2187]; symGroupMembers = new int[594][]; for (int i = 0; i < twistSymGroup.Length; i++) { twistSymGroup[i] = -1; } int numGroups = 0; Cube c = new Cube(); for (int i = 0; i < twistSymGroup.Length; i++) { if (twistSymGroup[i] < 0) { c.SetCornerTwistFromIndex(i); int s0 = c.GetCornerTwistIndex(); c.MirrorUD(); int ud = c.GetCornerTwistIndex(); c.MirrorLR(); int ud_lr = c.GetCornerTwistIndex(); c.MirrorUD(); int lr = c.GetCornerTwistIndex(); c.MirrorLR(); if (s0 != c.GetCornerTwistIndex() || i != s0) { Console.WriteLine("ERROR: symmetry action do not match original situation!"); } int g = numGroups++; if (twistSymGroup[s0] >= 0 || twistSymGroup[ud] >= 0 || twistSymGroup[lr] >= 0 || twistSymGroup[ud_lr] >= 0) { Console.WriteLine("ERROR: Overwriting symmetry group member"); } twistSymGroup[s0] = g; twistSymGroup[ud] = g; twistSymGroup[lr] = g; twistSymGroup[ud_lr] = g; symGroupMembers[g] = new int[] { s0, ud, lr, ud_lr }; // Console.Write(g + ": " + s0 + " " + ud+ " " + lr+ " " + ud_lr + " "); // if ((numGroups % 2) == 0) Console.WriteLine(); } } }
private static void BuildTwistSymGroup() { twistSymGroup = new int[2187]; symGroupMembers = new int[594][]; for (int i = 0; i < twistSymGroup.Length; i++) { twistSymGroup[i] = -1; } int numGroups = 0; Cube c = new Cube(); for (int i=0; i<twistSymGroup.Length; i++) { if (twistSymGroup[i]<0) { c.SetCornerTwistFromIndex(i); int s0 = c.GetCornerTwistIndex(); c.MirrorUD(); int ud = c.GetCornerTwistIndex(); c.MirrorLR(); int ud_lr = c.GetCornerTwistIndex(); c.MirrorUD(); int lr = c.GetCornerTwistIndex(); c.MirrorLR(); if (s0!=c.GetCornerTwistIndex() || i!=s0) { Console.WriteLine("ERROR: symmetry action do not match original situation!"); } int g = numGroups++; if (twistSymGroup[s0] >= 0 || twistSymGroup[ud]>=0 || twistSymGroup[lr]>=0 || twistSymGroup[ud_lr]>= 0) { Console.WriteLine("ERROR: Overwriting symmetry group member"); } twistSymGroup[s0] = g; twistSymGroup[ud] = g; twistSymGroup[lr] = g; twistSymGroup[ud_lr] = g; symGroupMembers[g] = new int[] { s0, ud, lr, ud_lr }; // Console.Write(g + ": " + s0 + " " + ud+ " " + lr+ " " + ud_lr + " "); // if ((numGroups % 2) == 0) Console.WriteLine(); } } }