/* * This method positions any specified face in the bottom * of the cube (a face is specified by its central facelet). */ public static void GoToFace(string face, Cube a) { if (a.face [5].square [1, 1].ToString() == face) { a.Roll(); a.Roll(); } else if (a.face [4].square [1, 1].ToString() == face) { a.Roll(); } else if (a.face [3].square [1, 1].ToString() == face) { a.TurnCubeCW(); a.Roll(); } else if (a.face [2].square [1, 1].ToString() == face) { a.TurnCube180(); a.Roll(); } else if (a.face [1].square [1, 1].ToString() == face) { a.TurnCubeCCW(); a.Roll(); } }
/* * Used only by the Randomizer function, to return the cube to the original position * Not necessary if MoveCube is building the cube through color scan */ private static void GoToInitial(Cube a) { GoToFace("F", a); switch (a.face [1].square[1, 1].ToString()) { case "L": a.TurnCubeCW(); break; case "R": a.TurnCubeCCW(); break; case "U": a.TurnCube180(); break; } }
/* * This method positions any specified face in the bottom * of the cube (a face is specified by its central facelet). */ public static void GoToFace(string face, Cube a) { if (a.face [5].square [1, 1].ToString() == face) { a.Roll (); a.Roll (); } else if (a.face [4].square [1, 1].ToString () == face) { a.Roll (); } else if (a.face [3].square [1, 1].ToString () == face) { a.TurnCubeCW (); a.Roll (); } else if (a.face [2].square [1, 1].ToString () == face) { a.TurnCube180 (); a.Roll (); } else if (a.face [1].square [1, 1].ToString () == face) { a.TurnCubeCCW (); a.Roll (); } }
/* * Used only by the Randomizer function, to return the cube to the original position * Not necessary if MoveCube is building the cube through color scan */ private static void GoToInitial(Cube a) { GoToFace ("F", a); switch (a.face [1].square[1,1].ToString()) { case "L": a.TurnCubeCW (); break; case "R": a.TurnCubeCCW (); break; case "U": a.TurnCube180(); break; } }