home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume15 / ioccc / part05 < prev    next >
Encoding:
Internet Message Format  |  1988-08-11  |  20.8 KB

  1. Subject:  v15i109:  International Obfuscated C Code Contest, Part05/07
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Landon Curt Noll <chongo@uts.amdahl.com>
  7. Posting-number: Volume 15, Issue 109
  8. Archive-name: ioccc/part05
  9.  
  10. # This is a shell archive.  Remove anything before this line, then
  11. # unpack it by saving it in a file and typing "sh file".  (Files
  12. # unpacked will be owned by you and have default permissions.)
  13. #
  14. # This archive contains:
  15. # ./1986/Makefile ./1986/README ./1986/applin.c ./1986/applin.hint
  16. # ./1986/august.c ./1986/august.hint ./1986/bright.c ./1986/bright.hint
  17. # ./1986/hague.c ./1986/hague.hint ./1986/holloway.c ./1986/holloway.hint
  18. # ./1986/marshall.c ./1986/marshall.hint ./1986/pawka.c ./1986/pawka.hint
  19. # ./1986/rules ./1986/stein.c ./1986/stein.hint ./1986/wall.c
  20. # ./1986/wall.hint
  21.  
  22. echo x - ./1986/Makefile
  23. sed -e 's/^X//' > "./1986/Makefile" << '//E*O*F ./1986/Makefile//'
  24. X# %W% %G% %U%
  25. X#
  26. X# 1986 makefile
  27. X
  28. XSHELL=/bin/sh
  29. XWINNERS=marshall hague applin bright stein holloway august pawka wall
  30. X
  31. Xall: ${WINNERS}
  32. X
  33. Xmarshall: marshall.c
  34. X    cc $? -o $@
  35. Xhague: hague.c
  36. X    cc $? -o $@
  37. Xapplin: applin.c
  38. X    cc $? -o $@
  39. Xbright: bright.c
  40. X    cc $? -o $@
  41. Xstein: stein.c
  42. X    -rm -f a.out
  43. X    cc $? -o $@
  44. X    -ln $@ a.out
  45. Xholloway: holloway.c
  46. X    cc $? -o $@
  47. Xaugust: august.c
  48. X    cc $? -o $@
  49. Xpawka: pawka.c
  50. X    cc $? -o $@
  51. Xwall: wall.c
  52. X    cc $? -o $@
  53. X
  54. Xclean:
  55. X    rm -f core
  56. Xclobber: clean
  57. X    rm -f ${WINNERS} a.out
  58. Xinstall: all
  59. X    @echo are you kidding'??'
  60. //E*O*F ./1986/Makefile//
  61.  
  62. echo x - ./1986/README
  63. sed -e 's/^X//' > "./1986/README" << '//E*O*F ./1986/README//'
  64. XThe 1986 contest was named: "The Third International Obfuscated C Code Contest"
  65. X
  66. XThe rules for 1986 suggested categories due to the success of the 1985
  67. Xjudging method.  The maximum size was increased from 512 to 1024 bytes.
  68. XLarry Bassel joined as the second official judge.
  69. X
  70. XA poll was taken for the worst code for BSD and System V program.
  71. XThe Bourne Shell (/bin/sh) won for both systems.  The BSD finger 
  72. Xprogram took third place.
  73. X
  74. XRules and results were posted to net.lang.c and net.unix-wizards.
  75. XMicro/Systems Journal published started regular publishing of the winners.
  76. XThe practice of making first announcement of the winners at the Summer
  77. XUsenix BOF started this year.  A notice was posted to net.announce.
  78. X
  79. //E*O*F ./1986/README//
  80.  
  81. echo x - ./1986/applin.c
  82. sed -e 's/^X//' > "./1986/applin.c" << '//E*O*F ./1986/applin.c//'
  83. Xcat =13 /*/ >/dev/null 2>&1; echo "Hello, world!"; exit
  84. X*
  85. X*  This program works under cc, f77, and /bin/sh.
  86. X*
  87. X*/; main() {
  88. X      write(
  89. Xcat-~-cat
  90. X     /*,'(
  91. X*/
  92. X     ,"Hello, world!"
  93. X     ,
  94. Xcat); putchar(~-~-~-cat); } /*
  95. X     ,)')
  96. X      end
  97. X*/
  98. //E*O*F ./1986/applin.c//
  99.  
  100. echo x - ./1986/applin.hint
  101. sed -e 's/^X//' > "./1986/applin.hint" << '//E*O*F ./1986/applin.hint//'
  102. XMost adaptable program: <hpfcdc!jack> Jack Applin
  103. X
  104. X    Jack Applin
  105. X    Hewlett-Packard
  106. X    Ft. Collins
  107. X    Colorado
  108. X    USA
  109. X
  110. XCompile and/or execute as directed by the documentation.
  111. X
  112. XThe judges were so amused by this little program that we created an
  113. Xaward just for it.  This program is portable to the C and Fortran 77
  114. Xcompilers as well as executable by the bourne shell!
  115. //E*O*F ./1986/applin.hint//
  116.  
  117. echo x - ./1986/august.c
  118. sed -e 's/^X//' > "./1986/august.c" << '//E*O*F ./1986/august.c//'
  119. Xtypedef struct n{int a:3,
  120. Xb:29;struct n*c;}t;t*
  121. Xf();r(){}m(u)t*u;{t*w,*z;
  122. Xz=u->c,q(z),u->b=z->b*10,
  123. Xw=u->c=f(),w->a=1,w->c=z->
  124. Xc;}t*k;g(u)t*u;{t*z,*v,*p,
  125. X*x;z=u->c,q(z),u->b=z->b,v
  126. X=z->c,z->a=2,x=z->c=f(),x
  127. X->a=3,x->b=2,p=x->c=f(),p
  128. X->c=f(),p->c->a=1,p->c->c=
  129. Xv;}int i;h(u)t*u;{t*z,*v,*
  130. Xw;int c,e;z=u->c,v=z->c,q(
  131. Xv),c=u->b,e=v->b,u->b=z->b
  132. X,z->a=3,z->b=c+1,e+9>=c&&(
  133. Xq(z),e=z->b,u->b+=e/c,w=f(
  134. X),w->b=e%c,w->c=z->c,u->c=
  135. Xw);}int(*y[4])()={r,m,g,h};
  136. Xchar *sbrk();main(){t*e,*p,*o;
  137. Xo=f(),o->c=o,o->b=1,e=f(),
  138. Xe->a=2,p=e->c=f(),p->b=2,
  139. Xp->c=o,q(e),e=e->c,(void)write
  140. X(1,"2.",2);for(;;e=e->c){q(e),
  141. Xe->b=write(1,&e->b["0123456789"],
  142. X1);}}t*f(){return i||(i=1000,
  143. Xk=(t*)sbrk(i*sizeof(t))),k+--i;
  144. X}q(p)t*p;{(*y[p->a])(p);}
  145. //E*O*F ./1986/august.c//
  146.  
  147. echo x - ./1986/august.hint
  148. sed -e 's/^X//' > "./1986/august.hint" << '//E*O*F ./1986/august.hint//'
  149. XBest complex task done in a complex way: <augustss@chalmers> Lennart Augustsson
  150. X
  151. X    Lennart Augustsson
  152. X    Dept. of Comp. Sci.
  153. X    Chalmers University of Technology,
  154. X    412 96 Gothenburg
  155. X    Sweden
  156. X
  157. XThis program computes a specific mathematical value.  Simply compile
  158. Xand give it an infinite amount of stack space and cpu time.  Otherwise
  159. Xjust be satisfied with the approximation displayed just before the core
  160. Xdump.
  161. X
  162. XThis program will pass lint on your system assuming your lint is brave
  163. Xenough to try and parse it correctly.
  164. //E*O*F ./1986/august.hint//
  165.  
  166. echo x - ./1986/bright.c
  167. sed -e 's/^X//' > "./1986/bright.c" << '//E*O*F ./1986/bright.c//'
  168. X#include <stdio.h>
  169. X#define O1O printf
  170. X#define OlO putchar
  171. X#define O10 exit
  172. X#define Ol0 strlen
  173. X#define QLQ fopen
  174. X#define OlQ fgetc
  175. X#define O1Q abs
  176. X#define QO0 for
  177. Xtypedef char lOL;
  178. X
  179. XlOL*QI[] = {"Use:\012\011dump file\012","Unable to open file '\x25s'\012",
  180. X "\012","   ",""};
  181. X
  182. Xmain(I,Il)
  183. XlOL*Il[];
  184. X{    FILE *L;
  185. X    unsigned lO;
  186. X    int Q,OL[' '^'0'],llO = EOF,
  187. X
  188. X    O=1,l=0,lll=O+O+O+l,OQ=056;
  189. X    lOL*llL="%2x ";
  190. X    (I != 1<<1&&(O1O(QI[0]),O10(1011-1010))),
  191. X    ((L = QLQ(Il[O],"r"))==0&&(O1O(QI[O],Il[O]),O10(O)));
  192. X    lO = I-(O<<l<<O);
  193. X    while (L-l,1)
  194. X    {    QO0(Q = 0L;((Q &~(0x10-O))== l);
  195. X            OL[Q++] = OlQ(L));
  196. X        if (OL[0]==llO) break;
  197. X        O1O("\0454x: ",lO);
  198. X        if (I == (1<<1))
  199. X        {    QO0(Q=Ol0(QI[O<<O<<1]);Q<Ol0(QI[0]);
  200. X            Q++)O1O((OL[Q]!=llO)?llL:QI[lll],OL[Q]);/*"
  201. X            O10(QI[1O])*/
  202. X            O1O(QI[lll]);{}
  203. X        }
  204. X        QO0 (Q=0L;Q<1<<1<<1<<1<<1;Q+=Q<0100)
  205. X        {    (OL[Q]!=llO)? /* 0010 10lOQ 000LQL */
  206. X            ((D(OL[Q])==0&&(*(OL+O1Q(Q-l))=OQ)),
  207. X            OlO(OL[Q])):
  208. X            OlO(1<<(1<<1<<1)<<1);
  209. X        }
  210. X        O1O(QI[01^10^9]);
  211. X        lO+=Q+0+l;}
  212. X    }
  213. X    D(l) { return l>=' '&&l<='\~';
  214. X}
  215. //E*O*F ./1986/bright.c//
  216.  
  217. echo x - ./1986/bright.hint
  218. sed -e 's/^X//' > "./1986/bright.hint" << '//E*O*F ./1986/bright.hint//'
  219. XMost useful obfuscation: <dataio!bright> Walter Bright
  220. X
  221. XCompile this program and give filenames as arguments.  For example try:
  222. X
  223. X    bright bright.c
  224. X    bright bright
  225. X
  226. XMr. Bright exploits the c pre-processor, similar variables and
  227. Xexcessive shifting to obfuscate an otherwise useful binary display
  228. Xprogram.  This gives you a small example of what it is like to
  229. Xmaintain the Bourne shell! :-}
  230. //E*O*F ./1986/bright.hint//
  231.  
  232. echo x - ./1986/hague.c
  233. sed -e 's/^X//' > "./1986/hague.c" << '//E*O*F ./1986/hague.c//'
  234. X#define    DIT    (
  235. X#define    DAH    )
  236. X#define    __DAH    ++
  237. X#define DITDAH    *
  238. X#define    DAHDIT    for
  239. X#define    DIT_DAH    malloc
  240. X#define DAH_DIT    gets
  241. X#define    _DAHDIT    char
  242. X_DAHDIT _DAH_[]="ETIANMSURWDKGOHVFaLaPJBXCYZQb54a3d2f16g7c8a90l?e'b.s;i,d:"
  243. X;main            DIT            DAH{_DAHDIT
  244. XDITDAH            _DIT,DITDAH        DAH_,DITDAH DIT_,
  245. XDITDAH            _DIT_,DITDAH        DIT_DAH DIT
  246. XDAH,DITDAH        DAH_DIT DIT        DAH;DAHDIT
  247. XDIT _DIT=DIT_DAH    DIT 81            DAH,DIT_=_DIT
  248. X__DAH;_DIT==DAH_DIT    DIT _DIT        DAH;__DIT
  249. XDIT'\n'DAH DAH        DAHDIT DIT        DAH_=_DIT;DITDAH
  250. XDAH_;__DIT        DIT            DITDAH
  251. X_DIT_?_DAH DIT        DITDAH            DIT_ DAH:'?'DAH,__DIT
  252. XDIT' 'DAH,DAH_ __DAH    DAH DAHDIT        DIT
  253. XDITDAH            DIT_=2,_DIT_=_DAH_;    DITDAH _DIT_&&DIT
  254. XDITDAH _DIT_!=DIT    DITDAH DAH_>='a'?    DITDAH
  255. XDAH_&223:DITDAH        DAH_ DAH DAH;        DIT
  256. XDITDAH            DIT_ DAH __DAH,_DIT_    __DAH DAH
  257. XDITDAH DIT_+=        DIT DITDAH _DIT_>='a'?    DITDAH _DIT_-'a':0
  258. XDAH;}_DAH DIT DIT_    DAH{            __DIT DIT
  259. XDIT_>3?_DAH        DIT             DIT_>>1 DAH:'\0'DAH;return
  260. XDIT_&1?'-':'.';}__DIT DIT            DIT_ DAH _DAHDIT
  261. XDIT_;{DIT void DAH write DIT            1,&DIT_,1 DAH;}
  262. //E*O*F ./1986/hague.c//
  263.  
  264. echo x - ./1986/hague.hint
  265. sed -e 's/^X//' > "./1986/hague.hint" << '//E*O*F ./1986/hague.hint//'
  266. XWorst abuse of the C preprocessor: <ukc!jmh> Jim Hague
  267. X
  268. X    Jim Hague
  269. X    University of Kent at Canterbury
  270. X    Canterbury, Kent
  271. X    UK
  272. X
  273. XCompile this program and feed ascii text into standard input.  This
  274. Xprogram is known to pass lint on some systems and abort lint on
  275. Xothers.
  276. X
  277. XThis program was selected for the 1987 t-shirt collection.
  278. X
  279. XThink morse code when you ponder this program.  Note how use of
  280. Xsimilar variables can be obfuscating!  The author notes that this
  281. Xprogram implements the international morse standard.  Now for extra
  282. Xcredit, what morse message does the program spell out?
  283. //E*O*F ./1986/hague.hint//
  284.  
  285. echo x - ./1986/holloway.c
  286. sed -e 's/^X//' > "./1986/holloway.c" << '//E*O*F ./1986/holloway.c//'
  287. X#include "stdio.h"
  288. X#define    e 3
  289. X#define    g (e/e)
  290. X#define    h ((g+e)/2)
  291. X#define    f (e-g-h)
  292. X#define    j (e*e-g)
  293. X#define k (j-h)
  294. X#define    l(x) tab2[x]/h
  295. X#define    m(n,a) ((n&(a))==(a))
  296. X
  297. Xlong tab1[]={ 989L,5L,26L,0L,88319L,123L,0L,9367L };
  298. Xint tab2[]={ 4,6,10,14,22,26,34,38,46,58,62,74,82,86 };
  299. X
  300. Xmain(m1,s) char *s; {
  301. X    int a,b,c,d,o[k],n=(int)s;
  302. X    if(m1==1){ char b[2*j+f-g]; main(l(h+e)+h+e,b); printf(b); }
  303. X    else switch(m1-=h){
  304. X    case f:
  305. X        a=(b=(c=(d=g)<<g)<<g)<<g;
  306. X        return(m(n,a|c)|m(n,b)|m(n,a|d)|m(n,c|d));
  307. X    case h:
  308. X        for(a=f;a<j;++a)if(tab1[a]&&!(tab1[a]%((long)l(n))))return(a);
  309. X    case g:
  310. X        if(n<h)return(g);
  311. X        if(n<j){n-=g;c='D';o[f]=h;o[g]=f;}
  312. X        else{c='\r'-'\b';n-=j-g;o[f]=o[g]=g;}
  313. X        if((b=n)>=e)for(b=g<<g;b<n;++b)o[b]=o[b-h]+o[b-g]+c;
  314. X        return(o[b-g]%n+k-h);
  315. X    default:
  316. X        if(m1-=e) main(m1-g+e+h,s+g); else *(s+g)=f;
  317. X        for(*s=a=f;a<e;) *s=(*s<<e)|main(h+a++,(char *)m1);
  318. X    }
  319. X}
  320. //E*O*F ./1986/holloway.c//
  321.  
  322. echo x - ./1986/holloway.hint
  323. sed -e 's/^X//' > "./1986/holloway.hint" << '//E*O*F ./1986/holloway.hint//'
  324. XBest simple task performed in a complex way: <drivax!holloway> Bruce Holloway
  325. X
  326. X    Bruce Holloway
  327. X    Digital Research, Inc.
  328. X    Monterey, CA
  329. X    USA
  330. X
  331. XBelieve it or not, this is the old standard "Hello, world" program
  332. Xperformed in a very complex way.  The judges and the author defy you
  333. Xdo determine how it does it.  It is a good thing that K&R didn't use
  334. Xthis version as the first C program!
  335. //E*O*F ./1986/holloway.hint//
  336.  
  337. echo x - ./1986/marshall.c
  338. sed -e 's/^X//' > "./1986/marshall.c" << '//E*O*F ./1986/marshall.c//'
  339. X                                                   extern int
  340. X                                                       errno
  341. X                                                         ;char
  342. X                                                            grrr
  343. X                             ;main(                           r,
  344. X  argv, argc )            int    argc                           ,
  345. X   r        ;           char *argv[];{int                     P( );
  346. X#define x  int i,       j,cc[4];printf("      choo choo\n"     ) ;
  347. Xx  ;if    (P(  !        i              )        |  cc[  !      j ]
  348. X&  P(j    )>2  ?        j              :        i  ){*  argv[i++ +!-i]
  349. X;              for    (i=              0;;    i++                   );
  350. X_exit(argv[argc- 2    / cc[1*argc]|-1<<4 ]    ) ;printf("%d",P(""));}}
  351. X  P  (    a  )   char a   ;  {    a  ;   while(    a  >      "  B   "
  352. X  /* -    by E            ricM    arsh             all-      */);    }
  353. //E*O*F ./1986/marshall.c//
  354.  
  355. echo x - ./1986/marshall.hint
  356. sed -e 's/^X//' > "./1986/marshall.hint" << '//E*O*F ./1986/marshall.hint//'
  357. XBest layout: <burdvax!eric> Eric Marshall
  358. X
  359. X    Eric Marshall
  360. X    System Development Corporation, a Burroughs Company
  361. X    P.O. Box 517
  362. X    Paoli, PA.
  363. X    19301
  364. X
  365. XThis program prints the name of the picture.  The layout is somewhat
  366. Xpretty through it is not the usual sort of output one would expect
  367. Xfrom printing a program!
  368. X
  369. XThis program was slected for the 1987 t-shirt collection.
  370. X
  371. XThis program is known to give some C compilers a problems.
  372. //E*O*F ./1986/marshall.hint//
  373.  
  374. echo x - ./1986/pawka.c
  375. sed -e 's/^X//' > "./1986/pawka.c" << '//E*O*F ./1986/pawka.c//'
  376. X#include "stdio.h"
  377. X#define xyxx char
  378. X#define xyyxx putchar
  379. X#define xyyyxx while
  380. X#define xxyyyx int
  381. X#define xxxyyx main
  382. X#define xyxyxy if
  383. X#define xyyxyy '\n'
  384. Xxyxx *xyx [] = {
  385. X"]I^x[I]k\\I^o[IZ~\\IZ~[I^|[I^l[I^j[I^}[I^n[I]m\\I]h",
  386. X"]IZx\\IZx[IZk\\IZk[IZo_IZ~\\IZ~[IZ|_IZl_IZj\\IZj]IZ}]IZn_IZm\\IZm_IZh",
  387. X"]IZx\\IZx[I^k[I\\o]IZ~\\IZ~\\I]|[IZl_I^j]IZ}]I^n[IZm\\IZm_IZh",
  388. X"]IZx\\IZx[IZk\\IZk[IZo_IZ~\\IZ~_IZ|[IZl_IZj\\IZj]IZ}]IZn_IZm\\IZm]IZh",
  389. X"]I^x[I]k\\IZo_I^~[I^|[I^l[IZj\\IZj]IZ}]I^n[I]m^IZh",'\0'};/*xyyxyxyxxxyxxxyy*/
  390. Xxyxx *xyyx; xxyyyx xyyyx,xyyyyx,xyyyyyx=0x59,xyyyyyyx=0x29,/*yxxyxyyyxxyyyxyy*/
  391. Xxxyx=0x68;xxxyyx(){xyyyyx=0;xyyyxx(xyx[xyyyyx]){xyyx=xyx[xyyyyx++];/*xyyyxxyx*/
  392. Xxyyyxx(*xyyx){xyyyx= *xyyx++-xyyyyyx;xyyyxx(xyyyx--)xyyxx(*xyyx-xyyyyyyx);/*x*/
  393. Xxyxyxy(*xyyx==xxyx)xyyxx(xyyxyy);*xyyx++;}}}/*xyxyxyyyyxxyxxxyyyxyyyxyxxyyy*/
  394. //E*O*F ./1986/pawka.c//
  395.  
  396. echo x - ./1986/pawka.hint
  397. sed -e 's/^X//' > "./1986/pawka.hint" << '//E*O*F ./1986/pawka.hint//'
  398. XMost illegible code: <PAWKA@NOSC-TECR.ARPA> Michael H. Pawka
  399. X
  400. X     Michael H. Pawka
  401. X    Naval Ocean Systems Center
  402. X    San Diego, Ca
  403. X    92152
  404. X
  405. XThe judges found this entry to be one of hardest to read without the
  406. Xaid of /lib/cpp and a good editor.  When run, the program asks if it
  407. Xis obfuscated, of all things!
  408. //E*O*F ./1986/pawka.hint//
  409.  
  410. echo x - ./1986/rules
  411. sed -e 's/^X//' > "./1986/rules" << '//E*O*F ./1986/rules//'
  412. XWARNING: The rules and mailing address for the contest change from year
  413. X         to year.  Be sure that you consult the current set of rules
  414. X     before submitting entries.
  415. X-------------------------------------------------------------------------------
  416. X
  417. XSubject: Third International Obfuscated C Code Contest Rules
  418. XNewsgroups: net.lang.c
  419. XKeywords: rules,1986,obfuscate,contest
  420. X
  421. XGOAL:  To write the most Obscure working C program following the rules below:
  422. X
  423. XRULES:    1) The source must be 1024 bytes or less.  NO exceptions!
  424. X
  425. X    2) Include in your letter:
  426. X        a) Name (or anonymous), Company/School, City, State and Country.
  427. X        b) Your path from a major network site, if applicable.
  428. X        c) A brief statement of what the program should do.
  429. X        d) The Machine(s)/Operating system(s) on which it runs.
  430. X        e) Enclose your source between the following lines:
  431. X        ---start of program---
  432. X        <place obfuscated source of 1024 bytes or less here>
  433. X        ---end of program---
  434. X
  435. X    3) The entry should be written in common C. (K&R + common extensions)
  436. X
  437. X    4) The program must be of original work.  All programs must be
  438. X       in the public domain.  All copyrighted programs will be rejected.
  439. X
  440. X    5) Entries must be received between 31-Mar-86 and 30-May-86 0:00 GMT.
  441. X       Email your entries to:
  442. X       
  443. X                decwrl!nsc!obfuscate
  444. X
  445. X       Entries sent by UUCP Email will be confirmed starting 1-May-86.
  446. X       People are encouraged to submit entries via Email, however one may
  447. X       mail entries the following address:
  448. X
  449. X        International Obfuscated C Code Contest
  450. X        National Semiconductor
  451. X        Attn: Landon Noll      Mail Stop: 7c266
  452. X        1135 Kern Ave.
  453. X        Sunnyvale, CA 94086
  454. X        U.S.A.
  455. X
  456. XAWARDS:    Winners of each category and the best of Show will be posted to
  457. X    net.announce as well as being published in the May 86 issue of the
  458. X    "Micro/Systems Journal".  Winners also get to receive international
  459. X    fame/flame for their efforts!
  460. X
  461. XJUDGING: Awards will be given to the best entry in a number of categories.
  462. X     The actual category list will vary depending on the types of entries
  463. X     we receive.  At the moment, we are considering using the following:
  464. X
  465. X        * The most obscure algorithm
  466. X        * The worst abuse of the C preprocessor
  467. X        * The strangest source layout
  468. X        * The best small one line program
  469. X        * The most useful program
  470. X        * <anything else we need to give recognition to a good entry>
  471. X
  472. X    Judging will be done by myself, Larry Bassel and other local people
  473. X    who are willing to help out.
  474. X
  475. X    We will attempt to run each of them on a Vax 785/4.2BSD system.
  476. X    Don't let the lack of such a system stop you!  Try to avoid operating
  477. X    system/machine specific code if you do not have such a system.
  478. X    Extra points will be given for programs which:
  479. X
  480. X        a) pass lint without complaint
  481. X        b) do something quasi-interesting
  482. X        c) are portable
  483. X
  484. X    A larger program size was selected to allow for a wider range of
  485. X    program ideas.  However if you don't need 1024 bytes don't use them.
  486. X    Given two programs with similar techniques and similar levels of
  487. X    obfuscation, we will tend to favor the more concise entry.
  488. X
  489. XPOLL:    We want to know what you think is the most poorly coded utility
  490. X    released with 4.xBSD and/or Sys V.  The top results plus the
  491. X    best flames will be posted along with the contest results.
  492. X    To vote, please    follow the guidelines below:
  493. X
  494. X    1) Include at the top of the letter:
  495. X        a) Name (or anonymous), Company/School, City, State and Country.
  496. X        b) Your path from a major network site, if applicable.
  497. X        c) the name of the poorly coded utility
  498. X        d) the name of the operating system on which it is found
  499. X        e) the line:    <<<FLAME ON>>>
  500. X        f)         up to 1024 bytes of flames
  501. X        g) the line:    <<<FLAME OFF>>>
  502. X
  503. X    2) Confine your vote to the standard set of commands.  I.e., don't
  504. X       flame about local commands or user contributed software.
  505. X
  506. X    3) Submit your votes via Email to:
  507. X
  508. X           for 4.xBSD:  decwrl!nsc!bsd_util
  509. X           for Sys V:   decwrl!nsc!sysV_util
  510. X
  511. X       or, you may send your votes by letter to the same address used by
  512. X       the contest.  Please place your votes on different sheets of paper.
  513. X
  514. Xchongo <C> /\cc/\
  515. //E*O*F ./1986/rules//
  516.  
  517. echo x - ./1986/stein.c
  518. sed -e 's/^X//' > "./1986/stein.c" << '//E*O*F ./1986/stein.c//'
  519. Xtypedef char*z;O;o;_=33303285;main(b,Z)z Z;{b=(b>=0||(main(b+1,Z+1),*Z=O%(o=(_%
  520. X25))+'0',O/=o,_/=25))&&(b<1||(O=time(&b)%0250600,main(~5,*(z*)Z),write(1,*(z*)Z
  521. X,9)));}
  522. //E*O*F ./1986/stein.c//
  523.  
  524. echo x - ./1986/stein.hint
  525. sed -e 's/^X//' > "./1986/stein.hint" << '//E*O*F ./1986/stein.hint//'
  526. XBest one liner: <gustaf!cd-jan> Jan Stein
  527. X
  528. XNOTE: to avoid problems with news and mail, the single line was split
  529. X      into 3 lines.  Join all lines into a single line to recreate
  530. X      the original file.
  531. X
  532. XCompile and link to a filename called 'a.out'.  Try the program with the
  533. Xfollowing argument:
  534. X
  535. X    a.out ^N^N
  536. X
  537. X(^N is ASCII control-N).  One some machines, ^M^L is needed to get it to
  538. Xoutput cleanly.  Your system may require another set of characters.
  539. XIn time, you will figure out what it does. :-)
  540. //E*O*F ./1986/stein.hint//
  541.  
  542. echo x - ./1986/wall.c
  543. sed -e 's/^X//' > "./1986/wall.c" << '//E*O*F ./1986/wall.c//'
  544. X#define _c(C)_ (C)&('|'+3):c_()(C)>>('\n'-3) __; /**/
  545. X#define C char*
  546. X#define keyboard ",,B3-u;.(&*5., /(b*(1\036!a%\031m,,,,,\r\n"
  547. X#define main(o,oo)oo(o){
  548. X#define _ ;case
  549. XC
  550. X#define c_(cc)c cc=
  551. X#define C_(sand)_O(sand)witch
  552. Xo=keyboard;
  553. X#define __ ;break;
  554. XC
  555. Xccc(
  556. Xcc)
  557. XC
  558. Xcc;
  559. X{
  560. XC
  561. Xcccc=
  562. Xcc;int
  563. X#ifndef lint
  564. X#define keyboard "dijs QH.soav Vdtnsaoh DmfpaksoQz;kkt oa, -dijs"
  565. X#endif
  566. Xc;
  567. Xmain(;c_(=(*cc);*cc++)c,for);
  568. X#define _O(s)s
  569. Xmain(0xb+(c>>5),C_(s))
  570. X_'\v'
  571. X:__ _'\f':
  572. Xmain(c,C_(s));
  573. X_c(8098)_c(6055)_c(14779)_c(10682)
  574. X#define O_(O)_O(O)stem(ccc(
  575. X_c(15276)_c(11196)_c(15150)
  576. X#define _C ;return
  577. X_c(11070)_c(15663)_c(11583)
  578. X}
  579. X__
  580. Xdefault
  581. X:c_(+)o[c&__LINE__-007];
  582. Xmain(c_(-)'-'-1,C_(s))_
  583. X0214
  584. X:_
  585. X0216
  586. X:c_(+)025 _
  587. X0207
  588. X:c_(-)4 _
  589. X0233
  590. X:c_(+)' '-1;
  591. X}}c_(&)'z'+5;
  592. X}_C cccc;
  593. X}main(,cc)
  594. XC
  595. X#define O write(1,
  596. Xc="O";
  597. XO_(sy) keyboard));
  598. Xmain(;;,for);
  599. Xread(0,
  600. Xc,1);*
  601. Xc_(&)'~'+1
  602. X;O ccc(
  603. Xc),
  604. X'\0');
  605. Xmain(*c,
  606. XC_(s));_
  607. X4
  608. X:O_(sy)";kkt -oa, dijszdijs QQ"))_C
  609. X_
  610. X13
  611. X:O o+' ',
  612. X3
  613. X)
  614. X#undef main
  615. X__ _ 127:O"\b \b",3)__
  616. Xdefault
  617. X:O
  618. Xc,1)
  619. X__}}}main(){
  620. Xcc();
  621. X}
  622. //E*O*F ./1986/wall.c//
  623.  
  624. echo x - ./1986/wall.hint
  625. sed -e 's/^X//' > "./1986/wall.hint" << '//E*O*F ./1986/wall.hint//'
  626. XThe grand prize in most well-rounded in confusion: <sdcrdcf!lwall> Larry Wall
  627. X
  628. X     Larry Wall
  629. X    System Development Corporation
  630. X    Santa Monica
  631. X    California
  632. X    US of A
  633. X
  634. XThe original version did not have a `;' character in the first line.
  635. XThis caused a number of System V C pre-preprocessors to gripe about a
  636. Xsyntax error.
  637. X
  638. XThis program is a masterpiece of obfuscation and humor.  Larry Wall
  639. X(the hacker who gave us rn and patch) asks you to compile and consider
  640. Xthe warning message generated by the C compiler.  Then execute the
  641. Xprogram and type charters into its standard input.  You will see why
  642. Xthe compiler documents the program.
  643. //E*O*F ./1986/wall.hint//
  644.  
  645. echo Possible errors detected by \'wc\' [hopefully none]:
  646. temp=/tmp/shar$$
  647. trap "rm -f $temp; exit" 0 1 2 3 15
  648. cat > $temp <<\!!!
  649.  36  96  530  Makefile
  650.  15  115  715  README
  651.  15  37  243  applin.c
  652.  13  57  358  applin.hint
  653.  26  34  718  august.c
  654.  15  79  514  august.hint
  655.  47  111  1020  bright.c
  656.  11  57  386  bright.hint
  657.  28  118  991  hague.c
  658.  17  93  578  hague.hint
  659.  33  72  912  holloway.c
  660.  11  66  381  holloway.hint
  661.  14  87  938  marshall.c
  662.  15  68  425  marshall.hint
  663.  18  41  838  pawka.c
  664.  10  51  300  pawka.hint
  665.  103  634  4048  rules
  666.  3  5  168  stein.c
  667.  14  85  501  stein.hint
  668.  78  125  1025  wall.c
  669.  17  103  625  wall.hint
  670.  539  2134  16214  total
  671. !!!
  672. wc  ./1986/Makefile ./1986/README ./1986/applin.c ./1986/applin.hint ./1986/august.c ./1986/august.hint ./1986/bright.c ./1986/bright.hint ./1986/hague.c ./1986/hague.hint ./1986/holloway.c ./1986/holloway.hint ./1986/marshall.c ./1986/marshall.hint ./1986/pawka.c ./1986/pawka.hint ./1986/rules ./1986/stein.c ./1986/stein.hint ./1986/wall.c ./1986/wall.hint | sed 's=[^ ]*/==' | diff -b $temp -
  673. exit 0
  674.  
  675.