Example #1
0
        public void RubixCubeSolver_SolvesRandomRubixCube()
        {
            var cube = new RubixCube();

            cube.Randomise();

            var solver = new RubixCubeSolver(cube);

            solver.Solve();

            Assert.AreEqual(_solvedCube, cube.Cube);
        }
Example #2
0
        private static void SolveRubixCube(Options opts)
        {
            var cube      = GetParsedCube(opts);
            var rubixCube = new RubixCube(cube);

            var solver = new RubixCubeSolver(rubixCube);

            solver.Solve();

            using var file = new StreamWriter(opts.OutputPath);
            foreach (var(num, direction, side) in rubixCube.Instructions)
            {
                file.WriteLine($"{num} - {direction}: {side}");
            }
        }