Beispiel #1
0
 public static void FillCell(this SudokuCell sudokuCell, int newFill)
 {
     if (sudokuCell == null)
     {
         new NullReferenceException();
     }
     else
     {
         if (sudokuCell.Possibilities.Contains(newFill))
         {
             sudokuCell.FillValue = newFill;
             Console.WriteLine("{0} now has fill value of {1}", sudokuCell.ToString(), newFill.ToString());
             Debug.WriteLine("{0} now has fill value of {1}", sudokuCell.ToString(), newFill.ToString());
             SudokuPuzzle.GetPuzzle().cellBoard.fillFrequencyCounter.IncrementFor(newFill);
         }
         else
         {
             Console.WriteLine("{0} not part of {1}'s possibilities", newFill.ToString(), sudokuCell.ToString());
         }
     }
 }
Beispiel #2
0
 public static void UnfillCell(this SudokuCell sudokuCell)
 {
     if (sudokuCell == null)
     {
         new NullReferenceException();
     }
     else
     {
         if (sudokuCell.isFilled)
         {
             int oldValue = sudokuCell.FillValue;
             sudokuCell.FillValue = 0;
             SudokuPuzzle.GetPuzzle().cellBoard.fillFrequencyCounter.DecrementFor(oldValue);
         }
         else
         {
             Console.WriteLine("{0} is already unfilled.", sudokuCell.ToString());
         }
     }
 }