Obfuscated C

I got bored this afternoon and at the prompting of Trav (who needs to update his website) I’ve been playing obfuscated C. I’ve got this far:

#include<stdio.h>
main(a,b,_){return(a==1)?(printf(“%d”,main(7,1608,0)),0):(a==2)?((_==0)?b:main(a,m
ain(3,0,(main(3,1,b)*_)),_-1)):(a==3)?((b==0)?_<<10:_>>10):(a==4)?(main(3,1,b*_)):
(a==5)?((b==2)?main(4,_,_):main(4,main(5,b-1,_),_)):(a==6)?(b/main(3,1,_)):(a==7)?
(b-main(6,main(5,3,b),main(2,main(3,0,3),2))+main(6,main(5,5,b),main(2,main(3,0,5)
,4))-main(6,main(5,7,b),main(2,main(3,0,7),6))+main(6,main(5,9,b),main(2,main(3,0,
9),8))-main(6,main(5,11,b),main(2,main(3,0,11),10))):0;}

You get a prize* if you can figure out what it does and how it does it.

* prize not guaranteed to actually exist. And yes, I know it prints 1025; I want to know why 🙂

Comments are closed.