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:
- If the number of mines indicated by this square is equal to the number of neighboring mines already flagged, clear any uncleared/unflagged neighbors.
- 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.
Project: paulswanson.name
November 25th, 2007 Filed Under projects
I recently registered paulswanson.name, and I want to put up a web registry for all of us who were born with the name ‘Paul Swanson’. I’d contact every Paul Swanson I can find, and hopefully many of them would register with some identifying but non-critical information: middle name, year of birth, childhood and current location, occupation, maybe parent’s first names. People looking for Paul Swanson would come to this site, and search by this information, with whichever Pauls want to be (or are already) public on a posted list with their current location and occupation.
I also registered commo.name in case I want to start the meta-service.
[next action: implement website with minimal design but functional logins, search page, and email forwarding. Estimate 4-80 hours depending on approach.]
Spaceship Earth Beta
November 13th, 2007 Filed Under projects, sustainability
I decided to launch Spaceship Earth Beta as a blog, allowing the setting to be used by other artists under a non-commercial Creative Commons license.
The design right now is pretty weak, so I put up a rentacoder bid request to see if I could get a reasonable design for some holiday cash. If anyone knows anyone who can draw and likes spaceships or sustainability, please send them my way!