My Computer Forum Computer Science Forum

Go Back   My Computer Forum > Computer Science Forum > Recreational Computing

Recreational Computing Computer Science Contests - TopCoder, C Obfuscation, ICPC (International Collegiate Programming Contest), etc.


Reply
 
LinkBack Thread Tools Display Modes
December 3rd, 2007, 08:54 AM   #1
 
Joined: Dec 2007
Posts: 138
IOCCC

Does anyone want to sift through some of the IOCCC (Obfuscated C) winners with me?
The link is here: http://www0.us.ioccc.org/years.html

I'll start by posting the source from one of the more intriguing 2004 winners:
//Burley.c

char a[80];
int e[4],g[5],c=100,h,i,j,k,b,f,s,t,p[4][1000];
int main(char*d){
return main((char*)(srand(time(&h)),
setjmp(p[2]),
(k=atoi((gets(a),
a+strspn(a," -"))))
&&(b=k),
b||++b,
j+=-j,
d=(char*)(&j),
setjmp(p[1]),
1<<1>j&&(k&=4>>3,
i=1<<k,
h<<=i+j,
setjmp(p[0]),
(h+=*d++-h)&&(-'1'^(h-='1'))&&(i<<=4,
setjmp(p[3]),
(i||!++i)&&(h--||(k|=i),
i/=2,
longjmp(p[3])),
longjmp(p[0])),
k^=-1,
k+=1<<037,
setjmp(p[3]),
k&&((--i<5&&1&k)&&(s=(rand()>>9)%0x4,
setjmp(p[0]),
t+=(rand()>>3)%015-t,
e[s]&(1<<t)&&longjmp(p[0]),
e[s]|=1<<t,
g[i]=t|++s<<"\004"["\004"[1]]|t),
k>>=1,
i+=1<<1,
longjmp(p[3])),
setjmp(p[0]),
putchar(0x20+!putchar(012+"(.7-A,G+@*J)/"[(017&(i=g[4-k]))*013%13])),
++k^005&&longjmp(p[0]),
putchar('\n'),
setjmp(p[3]),
putchar(0x1F+!!putchar(("BCDHS"[g[--k]>>4]))),
k&&longjmp(p[3]),
putchar('\n'),
j+=1<<0,
1^j||(d=(char*)gets(a)),
longjmp(p[1])),
s=1==(f=0),
i=0<<1,
setjmp(p[3]),
i<4&&(j=i+1,
setjmp(p[1]),
j<5&&((017&g[j])>(g[i]&15)&&(k=g[i],
g[i]=g[j],
g[j]=k),
j++,
longjmp(p[1])),
i++,
longjmp(p[3])),
setjmp(p[0]),
i--&&!((g[1+i]^g[i])>>4)&&longjmp(p[0]),
setjmp(p[1]),
--j&&(!(k=(g[j]&15)-(g[j-1]&017)+1)||(!(j-1)&&(8==-k)))&&longjmp(p[1]),
s+=3*!j|!(++i^17),
(j*=i*=4)&&(i=1),
setjmp(p[3]),
5-j<2&&(j=0,
setjmp(p[1]),
5-i>j&&((g[j]^g[j+1])&0xf?g[j]^=g[j]s+=((g[j]&0xf)>8&&f++,
!!g[j]*i)),
j++,
longjmp(p[1])),
i++,
longjmp(p[3])),
s=1^s?"AACEDJQZHello World"[s]-'A':!!f,
s+=(!i)*(6+12*s-!!s*(g[2]&017^0xa?8:-192)),
s--,
s*=b,
printf("$%d (%d) \n",
c+=s,
s+b),
i=0,
setjmp(p[0]),
6>i&&(j=1,
setjmp(p[1]),
0<=j&&(e[i+j]^=*(i-j+e+(j<<1)),
--j,
longjmp(p[1])),
i+=++i,
longjmp(p[0])),
longjmp(p[2])));
}

The first important thing to figuring out what's happening, is it's recursive, with no immediately discernible base case... And it only has one statement: return main(/*death goes here*/);
cknapp is offline  
 

My Computer Forum is free to register and we welcome everyone!

Reply

  My Computer Forum > Computer Science Forum > Recreational Computing

Tags
ioccc


« - | graphDS »

Thread Tools
Display Modes






Copyright © 2018 My Computer Forum Forum. All rights reserved.