Exemplo n.º 1
0
 public override bool Verify(int[] grid)
 {
     foreach (var c in AntiKnightConstraint.KnightsMoves(Cell, 9, 9, false))
     {
         if (grid[c] == grid[Cell])
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 2
0
 public static IList <SvgConstraint> Generate(int[] sudoku) => Enumerable.Range(0, 81)
 .Where(cell => AntiKnightConstraint.KnightsMoves(cell, 9, 9, false).All(c => sudoku[c] != sudoku[cell]))
 .Select(cell => new AntiKnight(cell))
 .ToArray();