Saturday, August 12th, 2006

othello widget

I've released another Yahoo widget - Othello. This was one of the first widgets I actually put together a couple of years ago (based on my Othello web page). I finally got around to polishing it up and making it do all the things a widget should do.
(Leave a comment)

Saturday, June 10th, 2006

widget goodness

I've been busy putting together yet another widget: Card Games. This one implements a few solitaire card games - currently Klondike (classic solitaire), Monte Carlo, and Pyramid. I've also got a Freecell implementation mostly complete, and am working on Golf next.

I took care with all these games to always provide a full Undo capability, as well as a Hint function that suggests a valid (but not necessarily the best) move. The inconsistency of undo capability is always something that annoyed me with Windows solitaire and freecell.

If anybody has any particular requests for new games, let me know!

(2 comments | Leave a comment)

Saturday, May 13th, 2006

mahjongg widget

I'm back to writing more widgets using the Yahoo! Widgets framework. This one is Mahjongg, the terribly addictive tile removal solitaire game. It includes an option to generate either a random initial game, or one that is guaranteed to have a solution. It also (optionally) times your game and keeps track of your fastest time.

Interestingly, the most difficult part of writing this was writing the algorithm that generates a solvable game. The general idea is to work backwards: Start with a blank board and place pairs of matching tiles on the board (in legal positions) until you reach the starting point. Then the solution is just doing the same thing the other way - ie. forwards, like you would play it. The problem is there are ways that the game generator can sort of paint itself into a corner. For example, if you have two tiles left to place on the board (which would be the first move of a solution), you can't place them side by side on one end of a row, because the player won't be able to remove them that way. If the game generator encounters such a situation, it just gives up and tries again from scratch. On average, the generator has to start over once or twice per valid generated game.

(7 comments | Leave a comment)

Tuesday, January 31st, 2006

foiled again

So I finished my earthquake widget about a week or so ago. I was waiting to send it to the Yahoo Widget Gallery so that the screen snapshot they take would have a nice big earthquake on it. Sure enough, on friday morning there was a 7.6 earthquake near Indonesia, which was big enough.

So I uploaded the widget on friday evening, and they only post new widgets on weekdays, so it went online yesterday afternoon. Today, there were several comments with vague comments about a load error (nobody actually bothered to specify what the error was). Since my desktop at work is Linux, I couldn't try it out there. I did notice that the USGS had redesigned the layout of their Earthquakes web site. The RSS feed seemed fine, though.

When I came home I found that my widget at home didn't work either. Further investigation showed that the USGS had set up a redirect from the old RSS URL to the new one, but the widget engine wasn't smart enough to automatically follow the redirect. So, I fixed the RSS URLs that it uses.

Furthermore, the RSS feed has links to the web pages for each specific earthquake. This is used by the widget to open a browser window when you request more info by double-clicking on the earthquake circle. However, the RSS feed currently points to .htm versions of the earthquake info pages - but they are now .php. I coded a workaround to simply strip off the ".htm" extension if present, because it appears that the pages work without having to explicitly include the extension.

Anyway, how frustrating that the very next day after uploading a shiny new widget to the gallery, and after over 3000 downloads, the USGS switches over to a new web site that breaks the widget. Oh well, I'll upload a fixed one right now that Yahoo should post tomorrow, that should be more resilient in the face of future changes.
(Leave a comment)

Friday, January 20th, 2006

earthquake widget

Based on the success of my last widget release, I decided to create another one. This widget shows the most recent earthquakes from the USGS earthquake server. You can select the minimum magnitude to show on the map, and you can zoom in up to 16x to show more detail in specific areas.

If you're using Yahoo Widgets, download the Earthquake Widget now, try it out and let me know if you find any problems. I've tried it on Windows XP and Mac OS X 10.4, but I'd like some more people trying it before I put this one on the widget gallery.

On a side note, the Periodic Table widget has nearly hit 10,000 downloads. That's quite some exposure.

(3 comments | Leave a comment)

Thursday, January 12th, 2006

yahoo widgets

About a year ago when Konfabulator released a version for Windows, I installed it and played with it a bit. I found it really easy to write widgets for it, and tried my hand at putting some together. Then I got distracted by other projects, and hadn't worked on it for a while.

Recently Konfabulator was bought by Yahoo and renamed Yahoo! Widgets. I wasn't paying much attention and had even quit running the old Konfabulator because it occasionally had stability problems on my laptop. It turns out that the new 3.0 version is very stable and has even more features that make writing widgets easier.

Anyway, I resurrected one of the simple ideas I had and created the Periodic Table widget. It's just a simple periodic table that lives on your desktop and shows you the most useful information about the elements. It doesn't do anything terribly fancy, just the facts.

The amazing thing is that in two days of it being posted on the Widget Gallery, it's had nearly four thousand downloads!

I've got several more ideas for widgets, so expect to see some others soon.
(3 comments | Leave a comment)