Originally Posted by
bobknows
this isnt really a solution...
i just included a whoel program that is structured completely different from his that does the same thing. besides, mine isnt finished yet. i just thought that it would be better to add my program to this thread instead of making a whole new one for the same purpose.
Add to it?! It's already far too large.
When you have code like this, you're doing it wrong:
Code:
case 1:
{
guess1 = true;
break;
}
case 2:
{
guess2 = true;
break;
}
...
case 8:
{
guess8 = true;
break;
}
case 9:
{
guess9 = true;
break;
}
When you have this many parameters, you're doing it wrong:
Code:
enternumber(bool g1, bool g2, bool g3, bool g4, bool g5, bool g6, bool g7, bool g8, bool g9, int x4, int y4)
One can learn a lot from that code in that it is in a lot of ways precisely how not to write a Sudoku solver.
If you know how to use arrays, then use arrays for crying out loud!
Yes I've written my own, using a bitboards approach with optimised backtracking. You probably don't want to hear how fast it is.