private void PerformLeftSwitch(Side face, Side side) { _cube.RotateAntiClockwise(Side.Back); _cube.RotateAntiClockwise(side); _cube.RotateClockwise(Side.Back); _cube.RotateClockwise(side); _cube.RotateClockwise(Side.Back); _cube.RotateClockwise(face); _cube.RotateAntiClockwise(Side.Back); _cube.RotateAntiClockwise(face); }
public void RotateAntiClockwise_CorrectlyRotatesTheFrontFace() { cube.RotateAntiClockwise(Side.Front); var face = cube.GetFace(Side.Front); Assert.AreEqual(Colour.Green, face[0, 0].Left); Assert.AreEqual(Colour.White, face[0, 0].Front); Assert.AreEqual(Colour.Orange, face[0, 0].Top); Assert.AreEqual(Colour.Blue, face[2, 2].Right); Assert.AreEqual(Colour.White, face[2, 2].Front); Assert.AreEqual(Colour.Red, face[2, 2].Bottom); }
private void ReOrientateBackEdge(Side side) { var sideToRotate = side switch { Side.Left => Side.Top, Side.Top => Side.Right, Side.Right => Side.Bottom, Side.Bottom => Side.Left, _ => throw new Exception("Not a valid side to rotate") }; _cube.RotateClockwise(side); _cube.RotateClockwise(sideToRotate); _cube.RotateAntiClockwise(Side.Back); _cube.RotateAntiClockwise(sideToRotate); _cube.RotateAntiClockwise(side); }