Coding Obfuscation

June 26, 2005

The The International Obfuscated C Code Contest has always been interesting. It's fun to read when it's intentional.

Ran across some great examples of obfuscation that started out making me laugh- then I quickly got disgruntled when I reflected on code i've read by other people. The first example shown is fun ...

char *p;
switch (n)
case 1:
    p = "one";
    if (0)
case 2:
    p = "two";
    if (0)
case 3:
    p = "three";
    printf("%s", p);

This reminds me of the example in coroutines.

Even cooler, is the Befunge programming language. I can't believe I've never seen it despite its age. It's a pretty inspirational piece of work at an inherent obfuscated programming language that adds a little more challenge as if it's needed.

Can you read this?

>310p0","     >"llaw eht no "v  >#v_ ^
^_210p0"--:"                 v  ,  
 :    v     " of beer"       <  :  
 -                >"selttob"00g.^ <     <
 1         >00g1-#^_$" elttob erom enO" ^
      >00g#^_$" selttob erom oN"        ^
 ^_110p0",dnuora ti ssap ,nwod eno ekaT"^
      ^             <

Related Posts