hi to all
I am a mechanic engineer and I had written a program to solving Sudoku,
and if your sudoku have more than one answer,it will be show all nswers;
But if you enter an empty sudoku,computer most claculate your answers in"for loop" for 9^81 times.
Is there any way to solve this problem?
Showing all answers is pointless because no one is going to look at all of them. Easiest is just to set a limit on how many solutions that you calculate. Another way is to show one or a few solutions at the same time and let the user press a button to see other solutions. For that to work you can build the solver in a way that makes it possible for it to run until it finds N answers, and be able to later continue the calculation from where it was. Each time the user press the button you just ask the solver for more solutions.