Exemple #1
0
            //Make this instance a deep copy of toCopy
            private void copy(gridSquare toCopy)
            {
                this.x = toCopy.x;
                this.y = toCopy.y;

                this.knownValue = toCopy.knownValue;
                for (int i = 1; i <= 9; ++i)
                {
                    this.possibilities[i] = toCopy.possibilities[i];
                }
                this.possList = new List <int>(toCopy.possList);

                this.solveType = toCopy.solveType;
                this.setList   = new PossibilitySet(toCopy.setList);
            }
Exemple #2
0
            //initialize/return to freshly constructed state
            public void setToInitialState()
            {
                knownValue = 0;

                for (int i = 1; i <= 9; ++i)
                {
                    possibilities[i] = true;
                }
                possList = new List <int> {
                    1, 2, 3, 4, 5, 6, 7, 8, 9
                };

                setList = new PossibilitySet(new HashSet <int>(possList), maxSetLength);

                solveType = SudokuGrid.SolveType.Unsolved;
            }