Site Moved

This site has been moved to a new location - Bin-Blog. All new post will appear at the new location.



Online Sudoku in JavaScript

I have released the first stable version of Sudoku - I have solved the 'impossible to solve' problem - that is, I have solved the bug in the game that causes the script to create impossible to solve puzzles. I have also added some neat features like...

  • The ability to restart the puzzle
  • Save the puzzle - and reload it when needed
  • Automatic completion of the puzzle
  • Create new puzzles at the touch of a button.

About the Algorithm

There is something that I wish to say about the algorithm behind the game - this is very...'sneaky'(for the lack of a better term). It does not create the game on the fly. I have provided a small number of 'base games' - completely solved puzzles. What my script does is to make new puzzles by replacing all the numbers on the game with different numbers. Then it will hide and make visible different parts of these puzzles - neat, huh? Someday I will create a true algorithm - but for now this will do.

My current problem is the script is some what large(about 25 KBs) - should I apply script compression or should I leave it as it is? Another problem is that the script is a little bit processor intensive - perhaps you won't notice it in your new system - but you should see it running in my 400 Megahertz machine. And I *hate* optimizing.

Apparently the game has caught on - some people are asking my permission for using the script on their site - and being a 'Open Source Guy', I am only too glad to oblige.

To Do

Future plans for Online Sudoku.

  • A hint system - the users will have an option that will warn them about a bad move(repeated numbers) right after they made the change. For example, the user will enter 7 and the script will give a warning that 7 already exists in the vertical row.
  • Optimize the script.
  • A better User interface - buttons to the right, etc.

All this when I get time - a very rare commodity these days.


Bob S said...

I have no objection to compressing scripts. If you want to be open-source-y, just include a brief comment with a URL to the un-compressed source at the top.

Sudoku Maniac said...

it's good if you dont obfuscate your script... so we can all read and understand the logic