Going Off On Tangents
Hatkirby on March 23rd, 2009 at 12:37:17pmI love how conversations, or even trains of thought, can go off on random tangents that end up somewhere completely different from where you began. For instance, this morning, I was bored and wanted to do something interesting having to do with a microblog (Automattic's new P2 Wordpress theme is really cool :) ), but I ended up writing an obfuscated C program that calculates a value of Phi. :)
First, I randomly searched Google for some interesting specialized themes, like P2, that could be useful. I found some that emulated Tumblelog, something I've wanted to recently. However, I had no clue what to do with my tumblelog, so I searched for it on Wikipedia and found that the name "Tumblelog" was coined by "why the lucky stiff". That name sounded familiar, so I looked into it by clicking on the link to his Wikipedia page.
Okay, maybe I'm easily sidetracked. :) Anyway, it turned out that he wrote "Why's (poignant) Guide to Ruby", which I used when I was learning Ruby. I clicked on the link to his website, for some reason, and was instantly greeted by his latest blog post, something to do with Hello World programs.
Being kind of random, I clicked the link in the post and found a collection of Hello World programs in different languages. I searched for some of the languages I knew, and eventually I found PHP's. Near PHP's was a language called Piet, which drew my attention because it was a graphical language, not a text language. By graphical, I mean that the source code is actually an image, not some text. Those are always interesting. :)
Anyway, I looked around and found some more pretty programs written in Piet, one of them called JAPH. It had no explanation of what it did, and it didn't execute properly on my computer, so I clicked on the link and found myself at a Wikipedia page called Just another Perl hacker.
Apparently JAPH is a meme where you obfuscate Perl programs that say "Just another Perl hacker" and put them in your signature. I tested a few examples that were on the page and was astonished that they actually worked. Now, obfuscated code is fascinating, so I clicked on the "Obfuscated Code" Wikipedia page to find more examples, and even found a step-by-step guide to obfuscating code!
So, I just had to write an obfuscated program. I eventually decided on calculating the Fibbinocci sequence up to 100. It came out nicely and obfuscated, but I wanted more, so I changed it to calculate Phi (which was easy because I already had the Fibbinocci sequence).
Happy with my code, I looked at the tabs I had open in Firefox and suddenly realized that I had gone off on a MASSIVE tangent. I had completely forgotten what I had started out looking for, a fun microblog thing to do. Weird.
Anyway, I feel like I should post my obfuscated C program. This is for last week's poll's Phi-lovers. :)
#include <stdio.h> _(double __,double ___){__+___<(sizeof(int)!=__LINE__ ?~(1<<sizeof(int)*8-1):~(1<<15))?_(___,__+___): printf("%-10.64f\n",1+__/___);}main(){_(1,1);}
Comments