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)); }
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); }
public SkewbSolverState RandomState(Random r) { var state = new SkewbSolverState { Perm = r.Next(4320) }; do { state.Twst = r.Next(2187); } while (!state.IsSolvable()); return(state); }