1234567891011121314151617181920212223242526 |
- using System.Collections.Generic;
- using uqac_ia_sudoku_csp.Interfaces;
-
- namespace uqac_ia_sudoku_csp.Solver.NextValueChoosers
- {
- public class BasicValueChooser : INextValueChooser
- {
- public void SelectVariable(Board board, out int x, out int y, IList<IConstraint> constraints)
- {
- for (var xx = 0; xx < board.Size; ++xx)
- {
- for (var yy = 0; yy < board.Size; ++yy)
- {
- if (board.GetNumber(xx, yy) == null)
- {
- x = xx;
- y = yy;
- return;
- }
- }
- }
- x = -1;
- y = -1;
- }
- }
- }
|