예제 #1
0
        public string GenerateExactly(SkewbSolverState state, int length, Random randomizeMoves)
        {
            var sol = new int[MaxSolutionLength];

            Search(0, state.Perm, state.Twst, length, -1, sol, randomizeMoves);
            return(GetSolution(sol));
        }
예제 #2
0
        public string SolveIn(SkewbSolverState state, int length, Random randomizeMoves)
        {
            var sol = new int[MaxSolutionLength];

            Search(0, state.Perm, state.Twst, length, -1, sol, randomizeMoves);
            if (_solutionLength != -1)
            {
                return(GetSolution(sol));
            }
            return(null);
        }
예제 #3
0
        public SkewbSolverState RandomState(Random r)
        {
            var state = new SkewbSolverState {
                Perm = r.Next(4320)
            };

            do
            {
                state.Twst = r.Next(2187);
            } while (!state.IsSolvable());
            return(state);
        }