home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1989 …il & Dave's Excellent CD / Excellent CD HFS.raw / Moof / Goodies / DTS Goodies / Obfuscated_C / 1986 / holloway.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-04-13  |  912 b   |  34 lines  |  [TEXT/MPS ]

  1. #include "stdio.h"
  2. #define    e 3
  3. #define    g (e/e)
  4. #define    h ((g+e)/2)
  5. #define    f (e-g-h)
  6. #define    j (e*e-g)
  7. #define k (j-h)
  8. #define    l(x) tab2[x]/h
  9. #define    m(n,a) ((n&(a))==(a))
  10.  
  11. long tab1[]={ 989L,5L,26L,0L,88319L,123L,0L,9367L };
  12. int tab2[]={ 4,6,10,14,22,26,34,38,46,58,62,74,82,86 };
  13.  
  14. main(m1,s) char *s; {
  15.     int a,b,c,d,o[k],n=(int)s;
  16.     if(m1==1){ char b[2*j+f-g]; main(l(h+e)+h+e,b); printf(b); }
  17.     else switch(m1-=h){
  18.     case f:
  19.         a=(b=(c=(d=g)<<g)<<g)<<g;
  20.         return(m(n,a|c)|m(n,b)|m(n,a|d)|m(n,c|d));
  21.     case h:
  22.         for(a=f;a<j;++a)if(tab1[a]&&!(tab1[a]%((long)l(n))))return(a);
  23.     case g:
  24.         if(n<h)return(g);
  25.         if(n<j){n-=g;c='D';o[f]=h;o[g]=f;}
  26.         else{c='\r'-'\b';n-=j-g;o[f]=o[g]=g;}
  27.         if((b=n)>=e)for(b=g<<g;b<n;++b)o[b]=o[b-h]+o[b-g]+c;
  28.         return(o[b-g]%n+k-h);
  29.     default:
  30.         if(m1-=e) main(m1-g+e+h,s+g); else *(s+g)=f;
  31.         for(*s=a=f;a<e;) *s=(*s<<e)|main(h+a++,(char *)m1);
  32.     }
  33. }
  34.