Monday, October 24, 2011

Solveduku

If you have never seen a Sudoku puzzle. You have never flipped through newspapers in the past few years. This Japanese originated puzzle has enjoyed worldwide attention.

The rules are extremely simple: fill up the grid using 1-9. Each digit must only be used once in each row, column, or the neighbor mini-grid. Each puzzle yearns a solution. I am not good at solving such puzzles... it takes a lot of trial and errors and it is ideal work for the computer.

Decent computer science students should have some idea how to solve this immediately upon seeing such puzzle. Real programmers should be able to crank one out in a few hours. This is just like the 8-queens back-tracking problem if we are to solve this using some trial-and-error approach.

Indeed, there are many such solvers on the Android market, and on the web. A few years ago I have written this program in command line, reading a puzzle in text file, then converted to java applet. I recently ported this to Android. That solver code is untouched, just the UI is different.




Get yours here

No comments:

Post a Comment