You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BasicValueChooser.cs 730B

1234567891011121314151617181920212223242526
  1. using System.Collections.Generic;
  2. using uqac_ia_sudoku_csp.Interfaces;
  3. namespace uqac_ia_sudoku_csp.Solver.NextValueChoosers
  4. {
  5. public class BasicValueChooser : INextValueChooser
  6. {
  7. public void SelectVariable(Board board, out int x, out int y, IList<IConstraint> constraints)
  8. {
  9. for (var xx = 0; xx < board.Size; ++xx)
  10. {
  11. for (var yy = 0; yy < board.Size; ++yy)
  12. {
  13. if (board.GetNumber(xx, yy) == null)
  14. {
  15. x = xx;
  16. y = yy;
  17. return;
  18. }
  19. }
  20. }
  21. x = -1;
  22. y = -1;
  23. }
  24. }
  25. }