I’m working on a solver for Sudoku, and happened to start writing it in Javascript (since just about everything else I’m doing these days in in that language). You can call it JScript, or ECMAScript, too. Same thing. To tell the truth, I very much like the language. The main problem is, it’s not fast, and although it seems that the actual problem I’m solving should (with the application of appropriate logic) be computationally very light, it bogs down the browser enough that the program is periodically interrupted with an “a script on this page is running slowly… would you like to continue running scripts?” message. I figured I could crank this program out right off the bat as a Web-page embedded Javascript, but debugging is a bit tough in that context, so perhaps it’s back to the drawing board. And yet, my program is 90% done. Come on brain, you can do it. Although it would be “easy” in C, part of the challenge lies in building an efficient algorithm that’ll yet work in a slow language like Javascript.
Also, check out “websudoku.com”:http://www.websudoku.com/, where they actually advertise puzzle-generation services for people who want to construct a book. Seems to me, once you have a solver program, actually generating puzzles should be a piece of cake. Method for generating puzzles: Take a completely filled-in Sudoku board, and “shuffle” it. Then start randomly removing numbers to create holes, and each time you remove a number, run a solver pass on the board. When you finally remove a number and the solver no longer can finds a solution, the game is ready. We can also control the “depth” the solver is allowed to search, so by setting the depth to something very shallow, we can make easy puzzles, and so on.
By “shuffle”, above, I mean that I’m sure there are a set of invariants by which applying them in the right order, any board can be transformed into any other board. For example, we could:
(a) Swap any row in sets [1-3],[4-6],[7-9] with another row in the same set.
(b) Swap any column with another column in the same manner.
(c) Exchange all of number X with all of number Y throughout the board.
Maybe that’s enough, in which case, only a small number of original puzzles of different “prototypes” are actually needed, and then they can be transformed into many other puzzles which seem completely different, but are really “topologically” the same.