So there's this web comic I like from a young-ish fellow Linux/perl geek called xkcd. The format is mainly stick figure drawings, although some panels are more realistic and show some skill and art training. I came across the following one recently, about the definition of "first base", "second base", etc. in relationships, which was a hoot:
http://xkcd.com/540/
I found it again today and noticed something I missed before. To the right of the first base foul line is the following sequence of numbers:
0110 0010 0110 0001
0111 0011 0110 0101
0010 0000 0011 0010
Knowing geeks like I do, I knew this was a binary sequence to represent ASCII, so I went about decoding it. First, set everything into groups of 8 instead of four:
01100010
01100001
01110011
01100101
00100000
00110010
Then apply a little math to convert them to base 10:
64 + 32 + 2 = 98
64 + 32 + 1 = 97
64 + 32 + 16 + 2 + 1 = 115
64 + 32 + 4 + 1 = 101
32... = 32
32 + 16 + 2 = 50
Then find them on an ASCII chart:
98 = b
97 = a
115 = s
101 = e
32 = [space]
50 = 2
Ah! Cute joke. I was a little upset that I didn't have a quick way to do this handy, maybe an Excel macro or a perl one-liner. Developing something to decode this programmatically would have been straightforward, but would also have taken longer than doing the 5 characters by hand (I knew the space on sight, which most geeks who have programmed in BASIC know from CHR/ASC commands).
I noticed a couple new things during the decoding, cutting the bitterness a bit: Numbers all start with 0011, and the first 15 lower case letters start with 0110. If I had known that ahead of time, I could have decoded that by sight based on the way he laid the numbers out, lacking only the "s".
My question: At what point did you stop reading and skip to the question?
Bonus question: Did the above question make you think of the word "recursive"?
No comments:
Post a Comment