RSS

Minesweeper Automation

October 26th, 2008   Filed Under code, games, portfolio, projects  

A few years ago, I was playing a lot of Minesweeper, and I realized that I was spending most of my time implementing two very simple rules repeatedly:

  1. If the number of mines indicated by this square is equal to the number of neighboring mines already flagged, clear any uncleared/unflagged neighbors.
  2. If the number of mines indicated by this square is equal to the number of neighboring mines already flagged plus the number of uncleared neighbors, then flag all uncleared neighbors as mines.

These rules should be obviously correct to anyone who’s ever played Minesweeper; in fact, I can’t even imagine making any progress in a Minesweeper game without them. So I decided to implement these rules in Gnomine, the open source version of Minesweeper that comes with Gnome on Linux. It only took me a few hours before I had this patch (applicable to gnome-games v2.20.1). Of course, this patch assumes that no mines are ever incorrectly flagged, but I think that’s a reasonable assumption.

And after playing with it, it’s surprising how much of the board can be cleared mechanically before you ever even get to any interesting decisions. When the sweeping does stop, what’s left are a few random decisions, where you can’t do any better than a 50/50 guess, and also the genuinely interesting positions where you have to apply set theory to make deductions.

I sent this patch off to the gnome-games mailing list owner, and have yet to receive a response. I’m sure that adding minor features to gnomine is absolutely no one’s top priority, but maybe if someone else has been similarly inspired, they might find this patch useful.



Youtube to MP3 Converter

August 19th, 2008   Filed Under code, portfolio, projects  

My mom found some of her favorite music on Youtube. She’s been looking for some of these songs for a long time, and now that she’s found them, she’s scared that Youtube will pull them and then she won’t have them again. She wants to download them so she can listen to them whenever she wants. The CDs are out of print. There are several torrents of this artist’s music that were around in 2006, but now they have 0 seeders (and 3 leechers). legalsounds.com has them for 10 cents apiece, but I cautioned her against giving her CC number to the Russians.

I know the quality of audio on Youtube is pretty bad, but she doesn’t care. She’s excited that she can finally listen to these songs again, and she’d be content with just having an mp3 constructed from the Youtube videos. In fact, she’d be ecstatic.

How hard can this be? I’m learning some jQuery myself–it’s all the rage, what with the mashups and the AJAX–and I thought I could make a simple client-side webpage that AT LEAST just gets at a user’s favorites from youtube and prints the URLs of each .flv for download. Youtube has a nice little API, you just GET from a sensible URL, and it returns XML. jQuery has some nice functionality to get elements from the XML and I would just add a few rows a table with the right information. No problems anticipated.
[More...]



Project: Reasonable Goods

November 25th, 2007   Filed Under activeprojects, portfolio, projects  

I realized I haven’t actually made a post about my main venture of late, Reasonable Goods. For any given consumer product category, there’s usually one brand or model that stands out as a great value. It’s not necessarily the cheapest, and it’s probably not the best, but it gets the job done, and it won’t be missing that one feature that everyone says you need.

The Swedish have a word, lagom, that captures this concept in its essence. In English, there is no direct equivalent, but it is often translated as “reasonable”.

Check it out! I’d love some feedback.



A Creation Myth for Science

August 5th, 2007   Filed Under featured, portfolio, science, writing  

Here is a scientifically accurate creation story, in the style of Genesis I. I did my best to keep mysticism, remove Yahweh, and incorporate certain substantial omissions from Moses’ version.



Orgo: An Organic Chemistry Board Game

March 25th, 2007   Filed Under portfolio  

In 2004, I put aside work on Mitochondrion and started work on Orgo, a “board game” meant to illuminate core principles of biochemistry, particularly the molecular structures and relative energies of simple biological molecules. It’s one of my many latent projects, but it’s complete enough to show and see if anyone out there wants to collaborate.