Thursday, May 10, 2007


So, the other day Rowr was talking to me about writing a sudoku solver. Just in case you've been living in a cave for the last 2 years, here's a sudoku webpage. Since I suck at figuring out sudokus, I figured I might as well write a solver, and it might be fun to do so. Anyway, I'm done with a working version. There are a few things about it that I figure I'd mention now.

Download the SudokuSolver here.

1) The program attempts to use built-in logic first, but if it gets stuck then it attempts a trial-and-error method (Nishio method). If this happens, then either the puzzle is complex or is deficient (see #2 below). The program will warn you if this method is invoked. There are likely other logic rules that I didn't put in, so my program might have to invoke the Nishio method when a good puzzle solver would not require it.

2) If it is given a deficient puzzle, meaning there is more than one solution, then the program should find a solution. So, even if you were to give it a blank board, some valid solution should appear.

3) You can set up the board using either the Quick Entry (81 edit boxes) or simply clicking on the graphical board. Clicking is much slower, but if you are making small tweaks, it might be simpler.

Oh, and look at the readme file for other info. This thing isn't perfect, and is provided as-is.

And, for those who don't trust random programs, here's a screenshot so you can see what you're missing out on.

1 comment:

Alex W said...

Hehe, that`s cheating man. I like solving them myself.

Long time no see tho. I just can`t stand MSN/AOL anymore.

Might be playing some cards again when I get a pay-check and my exams are over tho.