I found this C code on the net:
#include
main(t,_,a)char *a;{return!0main(-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"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}
They said it would compile, but at lest it didn't work on my compiler. (Microsoft visual c++, in school)
I tried to bum the code, and make it easier to read:
main(t,_,a) char *a;
{
return !0main(-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, "%+\q#\)\i%'l\;;\}")
:t<-50?_==*a?putchar(31[a]):main(-65,_,a+1):main((*a=='/')+t,_,a+1)
:0}
and after converting :? to if & else:
#include
main(t,x,a)
char* a
{
return if(!0if(t<3)
main(-79,-13,a+main(-87,1-x,main(-86,0,a+1)+a))
else
if(1,tmain(t+1,x,a)
else
if(3,main(-94,-27+t,a) && t==2)
if(_<13)
main(2,x+1, "%s %d %d\n" )
else
9
else
16
else
if(t<0)
if(t<-72)
main(x,t, "%+\q#\)\i%'l\;;\}")
else
if(t<-50)
if(x==*a)
putchar(31[a])
else
main(-65,x,a+1)
else
main((*a=='/')+t,x,a+1)
else
if(0main(2,2,"%s")
else
*a=='/'||main(0,main(-61,*a,"%n\n"),a+1);
}
(I replaced the _ with an x because _ annoyed me.) There are still 5 errors, the same 5 errors as when I started (meaning I've done the simplifying correctly)
Why won't it work? It says t, x & a are undeclared identifiers in the second line. (Call me a newbie, but why would you enter any variables in the main declaration? And what do they do? The other two errors are "function-style initializer appears to be a function definition" about the char *a on line 3, and unexpected EOF.
Please help me, the code made me so curious!