예제 #1
0
 public static bool IsCollision(SudokuField sudokuField)
 {
     for (var i = 1; i <= Data.MaxValue; i++)
     {
         if (IsDuplicate(sudokuField.GetRow(i)))
         {
             return(true);
         }
         if (IsDuplicate(sudokuField.GetColumn(i)))
         {
             return(true);
         }
         if (IsDuplicate(sudokuField.GetSection(i)))
         {
             return(true);
         }
     }
     return(false);
 }
예제 #2
0
 public static bool IsFilled(SudokuField sudokuField) => sudokuField.Field
 .Select(n => n.Value.Number)
 .Where(n => n == Data.Empty)
 .Count() == 0;