Esempio n. 1
0
        private SudokuSolver GuessFork()
        {
            Point position = GetSmallestOptionPosition();

            if (position.X < 0 || position.Y < 0)
            {
                return(null);
            }

            foreach (var opt in Data[position.X, position.Y].Notes)
            {
                SudokuSolver fork = SudokuSolver.Clone(this);

                // Set the guess
                fork.Data[position.X, position.Y].Value = opt;

                // Try to solve
                if (fork.Solve(true))
                {
                    return(fork);
                }
            }

            return(null);
        }