public DictionaryPossible(DictionaryPossible dp)
 {
     calculatedValue   = dp.calculatedValue;
     _possibilityCount = dp._possibilityCount;
     numberIsPossible  = new bool[10];
     dp.numberIsPossible.CopyTo(numberIsPossible, 0);
 }
        public DictionaryPossible(DictionaryPossible dP1, DictionaryPossible dP2, DictionaryPossible dP3)
        {
            numberIsPossible  = new bool[10];
            _possibilityCount = 0;
            int lastPossible = -1;

            for (int i = 1; i <= 9; i++)
            {
                numberIsPossible[i] = dP1.isPossible(i) && dP2.isPossible(i) && dP3.isPossible(i);
                if (numberIsPossible[i])
                {
                    lastPossible = i;
                    _possibilityCount++;
                }
            }

            if (_possibilityCount == 1)
            {
                calculatedValue = lastPossible;
            }
            else
            {
                calculatedValue = -1;
            }
        }
Beispiel #3
0
 public void addDictionary(DictionaryPossible dp)
 {
     for (int i = 1; i <= 9; i++)
     {
         if (dp.isPossible(i))
         {
             occurenceCount[i]++;
         }
     }
 }
Beispiel #4
0
 public OccurenceSet(DictionaryPossible dp)
 {
     occurenceCount = new int[10];
     for (int i = 1; i <= 9; i++)
     {
         if (dp.isPossible(i))
         {
             occurenceCount[i] = 1;
         }
     }
 }
 public void addPossibles(DictionaryPossible dp)
 {
     for (int number = 1; number <= 9; number++)
     {
         if (!numberIsPossible[number] && dp.numberIsPossible[number])
         {
             numberIsPossible[number] = true;
             _possibilityCount++;
         }
     }
 }
 public void addPossibilities(DictionaryPossible dp)
 {
     possible.addDictionary(dp);
 }
Beispiel #7
0
 public void setNumbers(DictionaryPossible newNumbers)
 {
     numbers = newNumbers;
 }
Beispiel #8
0
 protected internal SudokuCellSolve(CellIndices ci, DictionaryPossible dp)
 {
     numbers      = dp.copy();
     cellIndicies = new CellIndices(ci.row, ci.col);
 }
Beispiel #9
0
 public SudokuCellSolve(int row, int col)
 {
     numbers      = new DictionaryPossible();
     cellIndicies = new CellIndices(row, col);
 }