The following is an example of an obfuscated program, which is purposefully
made as difficult to read and/or confusing as possible.
For more information, visit the IOCCC.
Script started on Wed May 24 18:39:00 1995
quarg% cat jnk.c
#include <stdio.h>
#include <stdlib.h>
int *o=0,*O,_o,io,o_=0; oo(ooo){
if (ooo>1){
int o_o=ooo>>1,oo_=o_o+o_o+!(ooo%2);
if (o_o[o-1] < (ooo+~0)[o]) {
int O_,_o_ = o_o[O_=O[o_o-1],o-1];
o_o[o-1] = ooo[O[o_o-1]=ooo[O-1],o-1];
if ((oo_ < ooo) && (o_o[o-1]<=o[oo_-1])) {
int O_,_o_ = o_o[O_=O[o_o-1],o-1];
o_o[o-1] = oo_[O[o_o-1]=oo_[O-1],o-1];
oo_[O[ooo-1]=O_,o-1] = _o_;
}
ooo[O[ooo-1]=O_,o-1] = _o_;
oo(o_o);
} } }
ooo(){int ooo,z;
for(ooo=!0;ooo < o_;ooo<<=1);
ooo/=2;++ooo;
for(z=*(o_-ooo+o);ooo>1;ooo--)z=(z>o[o_-ooo])?o[-ooo+o_]:z;
return(z);
}
main(int at,char**oi){
io=sizeof(_o);
o= o?o:(O=malloc((o_=at)*io),malloc((_o=0,at*io)));
if(1 < at--){
int o1= o_-at-1;
o1[O[o1]=at-1,o] = atoi(*(at+oi));oo(++_o);main(at,oi);
} else {
int _i; fprintf(stdout, "Max is %d at index %d.\n", 0[o],O[0]);
fprintf(stdout, "Difference between max (%d) and min (%d) is %d.\n",
0[o],_i=ooo(),0[o]-_i);
}
return(0);
}
quarg% gcc jnk.c
quarg% a.out 7 4 1 6 9 2 3
Max is 9 at index 4.
Difference between max (9) and min (1) is 8.
quarg% exit
script done on Wed May 24 18:39:35 1995