C++ program for solving any 9x9 sudoku.?

F

flplini

Nowhere in the web have i been able to find a perfect program
in c++. Does any computer buff know it out there?
 
C

Clark S. Cox III

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.
 
R

Ron Natalie

Nowhere in the web have i been able to find a perfect program
in c++. Does any computer buff know it out there?
If you have specific C++ questions ask here.
For SODUKO solving strategies that might be amenable
to coding, google for it...there are at least one or
two sites that I know of.
 
M

Martin Steen

Nowhere in the web have i been able to find a perfect program
in c++. Does any computer buff know it out there?

I once wrote a program that can solve sudokus. But it's far from
being perfect, so I wouldn't give away the code ;)

Maybe you find something on the www (google for "sudoku solver c++").
There are even sites that can solve sudokus online, but i suppose
they are written in JavaScript, so your computer has to do the work.
http://www.sudokusolver.co.uk

Best regards,
-Martin
 
D

Default User

Clark said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top