public static bool CrossIsFormed(RubixCube cube, Side side) { var face = cube.GetFace(side); return(CrossFaceIsFormed(cube, side) && CenterEdgeBlockFacesAreSolved(face, side) && CentreBlocksAreOnCorrectFaces(cube)); }
public static bool CrossFaceIsFormed(RubixCube cube, Side side) { var face = cube.GetFace(side); return(SideIsCorrectColour(side, face[0, 1]) && SideIsCorrectColour(side, face[1, 0]) && SideIsCorrectColour(side, face[1, 2]) && SideIsCorrectColour(side, face[2, 1])); }
private static void PrintFaces(RubixCube cube) { for (var row = 0; row < 3; row++) { var left = cube.GetFace(Side.Left); PrintColour(cube.GetColour(left[row, 0], Side.Left)); Console.Write(" "); PrintColour(cube.GetColour(left[row, 1], Side.Left)); Console.Write(" "); PrintColour(cube.GetColour(left[row, 2], Side.Left)); Console.Write(" "); var front = cube.GetFace(Side.Front); PrintColour(cube.GetColour(front[row, 0], Side.Front)); Console.Write(" "); PrintColour(cube.GetColour(front[row, 1], Side.Front)); Console.Write(" "); PrintColour(cube.GetColour(front[row, 2], Side.Front)); Console.Write(" "); var right = cube.GetFace(Side.Right); PrintColour(cube.GetColour(right[row, 0], Side.Right)); Console.Write(" "); PrintColour(cube.GetColour(right[row, 1], Side.Right)); Console.Write(" "); PrintColour(cube.GetColour(right[row, 2], Side.Right)); Console.Write(" "); var back = cube.GetFace(Side.Back); PrintColour(cube.GetColour(back[row, 0], Side.Back)); Console.Write(" "); PrintColour(cube.GetColour(back[row, 1], Side.Back)); Console.Write(" "); PrintColour(cube.GetColour(back[row, 2], Side.Back)); Console.WriteLine(); Console.WriteLine(); } }
private static void PrintFace(RubixCube cube, Side side) { var face = cube.GetFace(side); for (var row = 0; row < 3; row++) { Console.Write(" "); // hack to indent top and bottom faces PrintColour(cube.GetColour(face[row, 0], side)); Console.Write(" "); PrintColour(cube.GetColour(face[row, 1], side)); Console.Write(" "); PrintColour(cube.GetColour(face[row, 2], side)); Console.WriteLine(); Console.WriteLine(); } }
private static bool CubeFaceIsSolved(RubixCube cube, Side side) { var face = cube.GetFace(side); return(BlockFacesAreSolved(side, face.Cast <Block>())); }