예제 #1
0
 public void Concat(StateHistory history)
 {
     States.AddRange(history.States);
 }
예제 #2
0
파일: Puzzle.cs 프로젝트: jussik/Sudoku
        /// <summary>
        /// Solve the <see cref="Puzzle"/>.
        /// </summary>
        public void Solve(string initialStateDescription)
        {
            if (SaveStateHistory) {
                State = new StateHistory();
                State.Add(Grid.SaveState(initialStateDescription));
            }

            InitLog2Lookup();

            // repeat all solvers until solved or no change happens in any solver
            while (!Solved) {
                if (!IterateSolvers(FindSingles,
                        FindHiddenSingles,
                        FindLockedCandidates1,
                        FindLockedCandidates2,
                        FindNakedPairs,
                        Guess))
                    break;
            }
        }