Calling all PHP programming Sudoku fans!
I’ve been running a free Sudoku game for a couple of years at www.grantgibson.co.uk/sudoku. It’s available to play in desktop and mobile formats as well as on widget sites like Netvibes.com.
The Flash part is really my area of expertise, but I also had to hack together a PHP script to generate the puzzles. I found a script that does the right sort of thing, and modified it to output in my required format. However, over the years I’ve had a few people complain that it produces puzzles with multiple solutions (and then only accepts one of those solutions as the ‘correct’ answer).
I don’t know enough mathematics or PHP to correct the problem, so I’m putting out an appeal. If anyone wants to have a go at correcting the problem — or rewriting the script — please do so. You’ll be helping me and thousands of other Sudoku fans around the world.
Requirements
Input parameters (via GET URL):
- Difficulty [currently 1, 2 or 3, but can be tweaked if necessary]
- Random [currently a six digit integer, but can be tweaked if necessary]
Output format (plain text):
puzzle=<TITLE>
Daily Random Sudoku: Medium
<AUTHOR>
Your Name Here
<COPYRIGHT>
Your Name Here and Grant Gibson
<DIFFICULTY>
2
<GRID>
.ooo..o..
o.o..oooo
o.o…ooo
o.o..oooo
oo.ooo.oo
oooo..o.o
ooo…o.o
oooo..o.o
..o..ooo.
<ANSWER>
528631974
163974285
497285631
235716849
671849352
984352716
859123467
312467598
746598123
… where answer is the unique grid solution, and grid represents the intial state of the puzzle - dot for blank, o for a displayed number.
I’ve attached the Current Grid Script here. If you’d like to suggest any revisions, or post up an alternative version of the code please do so — either as a comment here, or directly to me by email. See my contact page for email details.
Thanks, and good luck!
This exhibit allows visitors to edit their own news story, selecting video clips, applying blue-screen effects, applying captions and music to produce a news piece suitable for broadcast. Once complete, visitors can re-play their entire package as it would be shown on TV, complete with titles and credits.
This one features a touch-screen interface, webcam and large projection screen. Visitors are allowed to vote on the topic of the day, then have their head ‘beamed’ onto a cartoon body of their choice on the projection screen.
Organ Transplant was the last exhibit we developed and is probably the most popular of them all. It’s so popular that Glasgow Science Centre had to install a second terminal beside the first to meet demand. The high score table, controlled by an on-screen keyboard, has made things highly competitive — the current high score is 540, more than double my highest score!
I’ve just finished another online game for Glasgow Science Centre. The 
