Flickr Sudoku 1.1
For the last couple of days I've been obsessed with improving Flickr Sudoku, and the new version is now online!
Thanks to some hints from Siobhan I've finally started to get my head round the Flickr API, so that now you can create puzzles from a user name, or tag, or both. I've also tinkered with the interface a bit, and added "presets" that create puzzles from preset flickr group pools.
It's been a pretty self-indulgent exercise, really, but I found it was an excellent way of learning a bit more about web programming, particularly JavaScript which I'd never really got my head around before. Because the project I'd pitched myself was tantalisingly close to what I was able to do, it spurred me on to learn how to do it.
There was also a great sense of achievement getting things like the answer checking function to work. It checks the validity of each set of nine squares with a simple bit of code like this:
Thanks to some hints from Siobhan I've finally started to get my head round the Flickr API, so that now you can create puzzles from a user name, or tag, or both. I've also tinkered with the interface a bit, and added "presets" that create puzzles from preset flickr group pools.
It's been a pretty self-indulgent exercise, really, but I found it was an excellent way of learning a bit more about web programming, particularly JavaScript which I'd never really got my head around before. Because the project I'd pitched myself was tantalisingly close to what I was able to do, it spurred me on to learn how to do it.
There was also a great sense of achievement getting things like the answer checking function to work. It checks the validity of each set of nine squares with a simple bit of code like this:
for (var y=0; y<10; y+=1) {Which creates a checksum that can only equal 9876543210 if each grid square contains all the digits from 1 to 9. Which I thought was a pretty elegant way of doing it. Anyway, with the new version you can can finally play becky soduku, which alone makes it worth all the work!
checksum = checksum + (grid[i] * Math.pow(10,grid [i]));
}




Are you going to tell them?
Gasp! Immediate tranny transfusion needed. Pass me that Bow Ho' outfit. More pink! More pink!
Luckily it's only a bug in the sample I gave, the actual loops are more complex than that, and when I simplfied it I forgot that it only needed to count from 0 to 8. :)
Thanks for the heads-up Jo. x
Post a CommentPermalink Subscribe to comments: this post | all posts
<< T*Blog Home