Friday, December 17, 2010

Sudoku solver (Not finished yet)

Another application I've tried to make using only proce$$ing programming language is Sudoku solver.

I was and I still am wondering why are people fascinated by sudoku puzzles, which are in my opinion very boring and repetitive. And to totally eradicate any urges inside of me to solve another sudoku puzzle in the future I've (almost) written this application in proce$$ing.

There's one last chunk of algorithm missing still, but the application works in 95%. As usually with proce$$ing I didn't bother to add any visible GUI items, such as buttons or menus, so follow the instructions if you want to try it.

Here are some screenshots as how it works:
1. Find a sudoku you would like to solve

2. Rewrite the Sudoku starting numbers into their fields (just hover the cursor about the respective field and press number key)



3. Once you're done you're ready to start the solver! Click left mouse button. The Sudoku solver should add some new numbers (green ones) or mark conflicting numbers (red ones) in case something was wrong with initial numbers



4. Keep left-clicking until there's no field left empty. Numbers from previous step turn black (confirmed) and only new ones are marked as green and you'll have the puzzle solved in a seconds :)



Of course the rewriting of initial numbers can be long and bothersome, but you can alway try Goggles Sudoku from Google, which I admit is little bit more handy :)



P.S.: Here's the source code and here are the binary files (win 32bit).
I wasn't able to export a java applet for some reason, but I'll try it again once the application is fully completed.

P.S.2: Added option to change the size of Sudoku puzzle. Now it can handle 4x4, 6x6, 8x8 apart from classic 9x9 puzzle.

No comments:

Post a Comment