Clark S. Cox III wrote:
fl*****@i-image.com.tw wrote:
Nowhere in the web have i been able to find a perfect program
in c++. Does any computer buff know it out there?
Nope, but it shouldn't be that difficult to write, why don't you give
it a try.
That depends. A brute force one is doable, but coding in a more elegant
way is tougher.
I've been working on one in C, and it's now about as smart as I am at
solving puzzles. At least it got stuck on the hardest test one I had at
the same place I did.
Its methods are pretty much like mine, the biggest difference has to do
with checking for multiples within a block, row, or column. I didn't
come with a smooth way of building those up, so I have an init routine
that builds up all the possible combinations for the nine numbers in
tuples of cardinality 2, 3, or 4. The program uses the resulting table
to do its check.
I have to work up some algorithms based on more elaborate elimination
schemes like X-wing and such. I haven't because I don't understand
those yet :)
Brian