コード例 #1
0
        private static void Solve()
        {
            var configuration = ConfigurationGenerator.GenerateRandomConfiguration(3, 50);
            var solver = new BottomCrossSolver();

            solver.Solve(configuration).Wait(TestRunner.Timeout);

            CubeConfigurationAssert.FaceHasCrossOfColour(configuration, FaceType.Down, FaceColour.White);
        }
コード例 #2
0
        public async Task Solve_GivenWhiteOnFrontTopFaceAndMatchingColourOnBackFace_BottomBackCentreIsCorrect()
        {
            var solver = new BottomCrossSolver();
            var configuration = UnitTests.Helpers.CreateConfiguration(new[] { Rotations.BackClockwise, Rotations.RightAntiClockwise, Rotations.UpperClockwise }, 3);
            var solution = new List<IRotation>();

            await solver.CheckTopLayerForWhite(configuration, solution).ConfigureAwait(true);


            CubeConfigurationAssert.BottomBackCentreIsCorrect(configuration);
        }
コード例 #3
0
        public async Task Solve_GivenWhiteOnTopLeftFaceMatchingLeftCentre_BottomLeftCentreIsCorrect()
        {
            var solver = new BottomCrossSolver();
            var configuration = UnitTests.Helpers.CreateConfiguration(new[] { Rotations.Left2 }, 3);
            var solution = new List<IRotation>();

            await solver.CheckTopFaceForWhite(configuration, solution).ConfigureAwait(true);


            CubeConfigurationAssert.BottomLeftCentreIsCorrect(configuration);
        }
コード例 #4
0
        public async Task Solve_GivenWhiteInBottomFrontLayerAndJoiningFaceIsOnLeft_ExecutesAFrontLeftReverseFront()
        {
            var solver = new BottomCrossSolver();
            var configuration = UnitTests.Helpers.CreateConfiguration(new[] { Rotations.LeftAntiClockwise, Rotations.FrontAntiClockwise }, 3);
            var solution = new List<IRotation>();

            await solver.CheckBottomLayerForWhite(configuration, solution).ConfigureAwait(true);


            CollectionAssert.IsSubsetOf(new[] { Rotations.FrontClockwise, Rotations.LeftClockwise, Rotations.FrontAntiClockwise }, solution);
        }
コード例 #5
0
        public async Task Solve_GivenWhiteOnMiddleLeftFaceAndMatchingColourOnRightFace_PlacesWhiteOnToBottomLayer()
        {
            var solver = new BottomCrossSolver();
            var configuration = UnitTests.Helpers.CreateConfiguration(new[] { Rotations.LeftAntiClockwise}, 3);
            var solution = new List<IRotation>();

            await solver.CheckMiddleLayerForWhite(configuration, solution).ConfigureAwait(true);


            CollectionAssert.IsSubsetOf(new[] { Rotations.LeftClockwise }, solution);
        }