Jump to content

Suduko solver


gvp16

Recommended Posts

Hi guys, i need to make a suduko solver that completes the grid when you enter some of the numbers.

 

but i cant quite figure out how to do it, one way i can think is to compare all the values from the input boxes in a row/ column, and if they add up to the total then it is correct, but im sure there is a better/ more dynamic way.

 

I dont want someone to do the work for me, just a point in the write direction.

 

Thanks.

Link to comment
Share on other sites

Thanks for that, but i just cant get my head round how i check all the rows and colums for the correct combination

 

You can create a multidemensional array out of the POST elements, so you can easily compare (and thus calculate) a1, b1, c1 or a1, a2, a3 to solve it.

Link to comment
Share on other sites

I once wrote one in Standard ML as an extra optional assignment:

 

http://daniel0.net/sudoku.sml

And stripped off Danish comments that you probably can't read anyway + stripped sudoku generator (EDIT: well, you probably can't read the source code either, but I posted it anyway in case someone would be interested): http://daniel0.net/sudoku_no_comments.sml

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.