Hello! If it doesn't take much time, could you look at an error in my program?
I've made a program, that solves sudoku puzzles. It solves correct. But the program raises an error when I try to traverse solutions in a loop (sudoku can have many solutions). Looks like the error is raised in line:
for (int i=1; i<=search.getSolutionListener().solutionsNo(); i++){ ...
Hello! If it doesn't take much time, could you look at an error in my program?
I've made a program, that solves sudoku puzzles. It solves correct. But the program raises an error when I try to traverse solutions in a loop (sudoku can have many solutions). Looks like the error is raised in line:
If the puzzle has only one solution, then there is no errors.
If it's interesting, I used the method of solving sudoku from this site: http://www.ma.utexas.edu/users/cwhite/sudoku.html
The full souce code:
Add
before startting search, that is before line
Best,
/Kris
Thank you! Now it works.