Computer Science Canada

Christmas obfuscation

Author:  btiffin [ Mon Jan 19, 2009 4:22 pm ]
Post subject:  Christmas obfuscation

I got this from an acquaintance; didn't write it, wouldn't write it, couldn't write it.

I hope posting here is not a copyright infringement, but it's pretty neat.
c:

main(t,_,a )
    char *a;
{
    return !0<t?t<3?main(-79,-13,a+main(-87,1-_,main(-86, 0, a+1 )+a)):1,t<_?main( t+1, _, a ):3,main ( -94, -27+t, a )&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d %d\n" ):9:16:t<0?t<-72?main( _, t,"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c ;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/"):t<-50?_==*a ?putchar(31[a]):main(-65,_,a+1):main((*a == '/') + t, _, a + 1 ):0<t?main ( 2, 2 , "%s"):*a=='/'||main(0,main(-61,*a, "!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);
}

Compiles clean and you may be surprised by the output. And as far as I know; there are no Nasty McNasties buried in there, but ... buyer beware, just in case.

Cheers

Author:  CodeMonkey2000 [ Mon Jan 19, 2009 7:43 pm ]
Post subject:  RE:Christmas obfuscation

Wow that's pretty amazing. I still don't understand how the code works.

Author:  Vertico [ Mon Jan 19, 2009 7:56 pm ]
Post subject:  RE:Christmas obfuscation

Thats some intense recursion.

Author:  Vermette [ Tue Jan 20, 2009 2:14 pm ]
Post subject:  RE:Christmas obfuscation

It's been the first example offered on the wiki page for Obfuscated Code for some time. Doesn't change how awesome it is.

Author:  btiffin [ Wed Jan 21, 2009 8:56 pm ]
Post subject:  RE:Christmas obfuscation

Ok; cool. I was worried it was snagged out of a book with associated copyright.

So everyone knows, the code was authored (according to the above listed Wikipedia entry) by James Coplien, http://en.wikipedia.org/wiki/Jim_Coplien

Cheers

Author:  A.J [ Wed Jan 21, 2009 10:45 pm ]
Post subject:  Re: Christmas obfuscation

thanks btiffin!

and I thought my code was messy Razz

Author:  GiffordBruno [ Tue May 25, 2010 8:30 am ]
Post subject:  Re: Christmas obfuscation

Can you plz represent it in simple manner. It is beyond my capacity. Thanks

Author:  chrisbrown [ Tue May 25, 2010 10:28 am ]
Post subject:  Re: Christmas obfuscation

Welcome to CompSci.ca. Feel free to ask questions, but please don't revive threads that haven't been replied to in more than a few months at most.


GiffordBruno @ Tue May 25, 2010 8:30 am wrote:
Can you plz represent it in simple manner. It is beyond my capacity. Thanks

That's the point of obfuscation.

Author:  Velocity [ Mon Jan 16, 2012 11:22 am ]
Post subject:  RE:Christmas obfuscation

wow, do you have a ph.d in math or something?
That is amazing.

Author:  SNIPERDUDE [ Mon Jan 16, 2012 11:40 am ]
Post subject:  Re: RE:Christmas obfuscation

Velocity @ January 16th 2012, 11:22 am wrote:
wow, do you have a ph.d in math or something?

btiffin wrote:
So everyone knows, the code was authored (according to the above listed Wikipedia entry) by James Coplien, http//en.wikipedia.org/wiki/Jim_Coplien


1) Read through the posts before asking a question.
2) The last time this topic was alive was in 2010, please no necro-posting (unless there is a valid enough reason).

Author:  QuantumPhysics [ Wed Aug 08, 2012 11:39 pm ]
Post subject:  RE:Christmas obfuscation

This is amazing.


: