February 11, 2009

New Sudoku Algorithm - now with working puzzles!

Filed under: php, sudoku — grant @ 7:19 pm

I first developed my Sudoku game system back in 2005. Over the years thousands of people have played it and many have sent positive feedback. However, the one recurring issue since launch has been the quality of the computer generated grids - the quality was variable and often it would generate grids which had more than one possible solution (a bad thing in Sudoku circles).

It turns out that good, difficult Sudoku puzzles take a while to generate, solve and grade.  So whereas the old system spat out grids on-the-fly, the new system has to generate puzzles in advance.  Here’s roughly how it works…

  1. The system first generates a thousand or so puzzles with no particular restrictions.  These are quick to generate (approx 30 puzzles per second) and tend to be fairly easy puzzles to solve.
  2. It then generates a thousand puzzles that require at least one advanced technique (beyond the usual naked and hidden pairs).  These take much longer to generate (approx 4 puzzles per minute).
  3. Next, the system attempts to solve the puzzles using ‘human’ techniques (rather than brute force random guessing).  This gives each puzzle a grade.
  4. Finally, the solutions are de-duplicated and everything is stuffed into a MySQL database where they can be ordered by the grade they’ve been assigned.  This step is important, as some of the puzzles with no restrictions actually turn out to be really difficult, while some advanced technique puzzles actually turn out to be quite tame.

The database currently contains nearly 2000 unique puzzles, split into categories of Easy, Medium, Hard and Evil, based on their computed grade.

Please have a play here and let me know what you think.   Have I got the grading about right?   Are there any problems with the system?   Feedback is always appreciated.

September 23, 2006

Sudoku module for Netvibes

Filed under: flash, sudoku — grant @ 5:02 pm

I’ve been getting into Netvibes recently.  I’ll probably write more about it later, but for now just wanted to announce my first Netvibes module - MySudoku.

After looking at the other Sudoku modules available on Netvibes, I thought my own Sudoku engine improved on all of those in several key areas.  It took about three hours to convert my Flash app into Netvibes compatible code.

Just checked and there has been 34 downloads so far today.  Looks like Om Malik’s Widgetization of the Web might be the way forward.  It certainly gives exposure to small developers like myself, and will hopefully generate some useful feedback.

Take a look - my sudoku module page is here.

If you have a Netvibes account, add my module: Add to Netvibes

Â

September 9, 2006

Unlimited Sudoku!

Filed under: flash, sudoku — grant @ 9:49 am

When I launched my Flash-based Sudoku game, I had plans to update it at least once a week with new puzzles.  That was over a year ago - and in that time I only managed to update it a couple of times.  Also missing from the app was a bunch of features you’d expect to find in any decent Sudoku game - the ability to check your solution for one! 

A couple of weeks ago I decided it was time to take a fresh look at the app.  I’ve added a solution checker, keyboard navigation and a few other features to make it more friendly.  But most imporantly of all, I’ve added an automatic puzzle generator which will generate new puzzles for you every day. 

Take a look here: http://www.grantgibson.co.uk/sudoku/

Hopefully the app is now feature-complete and fairly bug free, but if you have any suggestions, questions or comments they’re always welcome.

Listening to now

Categories

Archives

Meta

Blog Tools

Add to Technorati Favorites

Powered by WordPress