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
https://forums.phpfreaks.com/topic/196285-suduko-solver/
Share on other sites

  Quote

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
https://forums.phpfreaks.com/topic/196285-suduko-solver/#findComment-1030784
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
https://forums.phpfreaks.com/topic/196285-suduko-solver/#findComment-1030792
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.