Randall Munroe of XKCD fame has said on multiple occasions that he chose the name XKCD mostly at random, considering only that it’s an unpronounceable combination of letters that hadn’t been previously used in any significant way. I’m not so sure. I’m apparently not the first one to realize this, but if you take A=1, B=2, and so on, adding up the values of XKCD gives 42.

I figured this out while I was playing around with Reg Braithwaite’s wonderful String#to_proc library. Here’s the code I used.

[?x,?k,?c,?d].map(&'_-96').fold(&'+')

In short, this generates an array of the ascii values for the letters x, k, c, and d, converts them from a=97 to a=1, then sums them. Unlike Symbol#to_proc, which is standard in recent versions of ruby, String#to_proc substitutes underscores with the current value.