1234567891011121314151617181920 |
- using uqac_ia_sudoku_csp.Interfaces;
-
- namespace uqac_ia_sudoku_csp.Solver.Constraints
- {
- public class ColumnConstraint : IConstraint
- {
- public bool Check(Board board, int x, int y)
- {
- var cell = board.GetNumber(x, y).Value;
- for (var yy = 0; yy < board.Size; ++yy)
- {
- if (cell == board.GetNumber(x, yy) && yy != y)
- {
- return false;
- }
- }
- return true;
- }
- }
- }
|