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

Discussion in 'C++' started by flplini@i-image.com.tw, Oct 23, 2006.

  1. Guest

    Nowhere in the web have i been able to find a perfect program
    in c++. Does any computer buff know it out there?
    , Oct 23, 2006
    #1
    1. Advertising

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

    --
    Clark S. Cox III
    Clark S. Cox III, Oct 23, 2006
    #2
    1. Advertising

  3. Ron Natalie Guest

    wrote:
    > 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.
    Ron Natalie, Oct 23, 2006
    #3
  4. Martin Steen Guest

    wrote:
    > 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
    Martin Steen, Oct 23, 2006
    #4
  5. Default User Guest

    Clark S. Cox III wrote:

    > 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
    Default User, Oct 23, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    1,021
    Oliver Wong
    Apr 26, 2006
  2. dorayme

    The Guardian's website Sudoku

    dorayme, May 31, 2006, in forum: HTML
    Replies:
    12
    Views:
    843
    Jim Higson
    Jun 4, 2006
  3. Replies:
    5
    Views:
    436
    Nigel Greenwood
    Jun 22, 2005
  4. Arun Nair
    Replies:
    3
    Views:
    269
    Paul McGuire
    Oct 26, 2006
  5. Lionel
    Replies:
    14
    Views:
    1,150
Loading...

Share This Page