An implementation of XKCD #1288