Previous Posts

Subscribe

Basic feed (just the blog)

The Uberfeed (blog, pics & links)

Via e-mail:

Becky's T-Blog

Saturday, August 13, 2005

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:
for (var y=0; y<10; y+=1) {

checksum = checksum + (grid[i] * Math.pow(10,grid [i]));

}
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!
Blogger Siobhan Curran  Impressed :-D

Are you going to tell them? 
Anonymous Gemma  More worrying - is this the start of "Becky Ubergeek"? Code fragments in blogs? Eeek! And it's contagious - Becky, you've a bug! If that's a grid of 9 squares, why are you doing 10 checks? (y=0..9)

Gasp! Immediate tranny transfusion needed. Pass me that Bow Ho' outfit. More pink! More pink! 
Blogger Becky  You're right... that is a bug! :-O

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. :) 
Blogger Joanna  Becks.. think you broke your template..... 
Blogger Becky  Hmm, seems to be working at the mo... what problem were you having? :-S 
Blogger Joanna  your sidebar doesnt begin until the last blog article.... in IE anyway.. 
Blogger Joanna  is OK in firefox... 
Blogger Becky  Ooops, looks like I.E. didn't like the preformatted text I'd used in that last posting.

Thanks for the heads-up Jo. x 
Blogger Joanna  ah thats better :-) 
Blogger Siobhan Curran  Ignore the IE users - they don't know what's good for them anyway :P 
Blogger Gemma  Hey, girl! Some of us like to use tools to do things, rather than scurrying about like maddened gophers looking for the next upgrade or wunder-app ;) 

Post a CommentPermalink     Subscribe to comments: this post | all posts

<< T*Blog Home