kafsemo.org

Futoshiki solver applet

2007-11-08

Sun are making another push towards a better Java runtime on the desktop. “Better”, in this case, meaning taking care of a few more ways that applets can turn users away.

I’m really keen to see this — the pincer movement of a quality desktop experience and opening the reference implementation can only help to deliver. Sun’s ambivalence over trademarks and branding notwithstanding, there’s still a lot of untapped potential.

The Guardian’s contribution to the genre of obsessive grid-filling games (of Sudoku, “As soon as I saw the grid with the empty squares, I felt very tempted to fill them in”) is Futoshiki. Being unable to do one week’s puzzle was enough to tip me over into writing a Futoshiki solver; it’s an applet, somewhat justifying the first paragraphs.

So here’s the test — how annoying is it to deploy? For Windows, I’ve got a JVM installed anyway. The Distributor License for Java makes a huge difference under Debian. Still very much non-free but certainly far more practical than before.

I’m not a huge fan of the suggested replacement for the ‘applet’ element. There may be a simpler form without all the browser sniffing Javascript if I’m prepared to give up on IE, but if I can bump my HTML down to ‘transitional’ and keep applet then that’s a whole lot simpler.

The actual implementation is an exercise in evolving GUI code, keeping unit tests passing without being too concerned with upfront design, and some profiled tuning of the solution algorithm. I’m still impressed by the combination of generics and collections, and still trying to figure out if wildcards aid expressivity or just overcomplicate the type system.

(Music: Bad Religion, “Submission Complete”)
(More from this year, or the front page? [K])