home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume14 / ioccc / part04 < prev    next >
Encoding:
Internet Message Format  |  1988-03-14  |  21.0 KB

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