Saturday, February 12, 2011

Sudoku

Sudoku is a fun game to play.  I wanted to write a program to solve sudoku for a while now.  Took some time and wrote up one today.  It can solve easy and medium puzzles off http://www.websudoku.com/.  I'm aware of a few limitations in it, so I don't expect it to solve all types of puzzles, but it does a lot.
I can always add brute-force for some extra hard puzzles, but I'd like to add as much smarts into it as I can before going down that road.

For now, I'm happy with the project the way it is, I give it this type of input file:
410290005
002000490
000004326
000600000
209030107
000001000
134900000
078000500
600018039

And this is the output:
413296875
862573491
597184326
781649253
249835167
356721948
134957682
978362514
625418739

I'm not a very graphical person, and haven't made a gui for it.  That can be done later, hopefully I'll be back to my book tomorrow.

No comments:

Post a Comment