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);
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }