Exemplo n.º 1
0
        private static void TestBackTurns()
        {
            Cube cube = new Cube();

            Console.WriteLine(cube);
            Console.ReadKey();

            cube.RotateUClock();

            Console.WriteLine(cube);
            Console.ReadKey();

            cube.RotateBClock();

            Console.WriteLine(cube);
            Console.ReadKey();

            cube.RotateUCounterClock();

            Console.WriteLine(cube);
            Console.ReadKey();

            cube.RotateBCounterClock();

            Console.WriteLine(cube);
            Console.ReadKey();

            cube.RotateBHalf();

            Console.WriteLine(cube);
            Console.ReadKey();
        }
Exemplo n.º 2
0
        public static Cube ApplyMove(Cube cube, Move move)
        {
            switch (move)
            {
            // TODO: expaaannddd
            case Move.B:
                cube.RotateBClock();
                break;

            case Move.BP:
                cube.RotateBCounterClock();
                break;

            case Move.B2:
                cube.RotateBHalf();
                break;

            case Move.L:
                cube.RotateLClock();
                break;

            case Move.LP:
                cube.RotateLCounterClock();
                break;

            case Move.L2:
                cube.RotateLHalf();
                break;

            case Move.D:
                cube.RotateDClock();
                break;

            case Move.DP:
                cube.RotateDCounterClock();
                break;

            case Move.D2:
                cube.RotateDHalf();
                break;

            case Move.F:
                cube.RotateFClock();
                break;

            case Move.FP:
                cube.RotateFCounterClock();
                break;

            case Move.F2:
                cube.RotateFHalf();
                break;

            case Move.R:
                cube.RotateRClock();
                break;

            case Move.RP:
                cube.RotateRCounterClock();
                break;

            case Move.R2:
                cube.RotateRHalf();
                break;

            case Move.U:
                cube.RotateUClock();
                break;

            case Move.UP:
                cube.RotateUCounterClock();
                break;

            case Move.U2:
                cube.RotateUHalf();
                break;

            default:
                break;
            }

            return(cube);
        }