コード例 #1
0
ファイル: StateHistory.cs プロジェクト: jussik/Sudoku
 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;
            }
        }