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

  1. Subject:  v15i111:  International Obfuscated C Code Contest, Part07/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 111
  8. Archive-name: ioccc/part07
  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. # ./1988/Makefile ./1988/README ./1988/applin.c ./1988/applin.hint
  16. # ./1988/dale.c ./1988/dale.hint ./1988/isaak.c ./1988/isaak.encode
  17. # ./1988/isaak.hint ./1988/litmaath.c ./1988/litmaath.hint
  18. # ./1988/phillipps.c ./1988/phillipps.hint ./1988/reddy.c
  19. # ./1988/reddy.hint ./1988/robison.c ./1988/robison.hint ./1988/rules
  20. # ./1988/spinellis.c ./1988/spinellis.data ./1988/spinellis.hint
  21. # ./1988/westley.c ./1988/westley.hint ./1988/zsmall.c
  22.  
  23. echo x - ./1988/Makefile
  24. sed -e 's/^X//' > "./1988/Makefile" << '//E*O*F ./1988/Makefile//'
  25. X# %W% %G% %U%
  26. X#
  27. X# 1988 makefile
  28. X
  29. XSHELL=/bin/sh
  30. XCFLAGS=-O
  31. XCC=cc
  32. XCPP=/lib/cpp
  33. X# you may need a version of cpp that is faster and/or allows more symbols
  34. X# than the standard cpp.  If so, adjust the BIG_CPP below.
  35. X#
  36. X# If you have the GNU cpp, you should use it below as it is MUCH faster
  37. X# than the standard cpp and does not have problems with memory usage.
  38. X# However you should note that the non-ANSI nature of defining symbols
  39. X# that start with '#' prevents GNU cpp from doing the initial pass.  
  40. X# Thus you should not use the GNU cpp for the ${CPP} symbol.
  41. XBIG_CPP=${CPP}
  42. X
  43. XWINNERS=dale phillipps robison westley reddy isaak \
  44. X    litmaath spinellis zsmall
  45. X
  46. Xall: ${WINNERS}
  47. X
  48. Xdale: dale.c
  49. X    ${CC} ${CFLAGS} $? -o $@
  50. Xphillipps: phillipps.c
  51. X    ${CC} ${CFLAGS} $? -o $@
  52. Xrobison: robison.c
  53. X    ${CC} ${CFLAGS} $? -o $@
  54. Xwestley: westley.c
  55. X    ${CC} ${CFLAGS} $? -o $@
  56. Xreddy: reddy.c
  57. X    ${CC} ${CFLAGS} $? -o $@
  58. Xisaak: isaak.c
  59. X    ${CC} ${CFLAGS} -DI=B -DO=- -Dy $? -o $@
  60. Xlitmaath: litmaath.c
  61. X    ${CC} ${CFLAGS} $? -o $@
  62. Xspinellis: spinellis.c spinellis.data
  63. X    @echo This program can not be portably compiled with a makefile
  64. X    @echo because it reads from /dev/tty.
  65. X    @echo Compile this program with: cc spinellis.c -o spinellis
  66. X    @echo and type the following text followed by an EOF '(^D)'.
  67. X    @cat spinellis.data
  68. X    @-if [ ! -f spinellis ]; then \
  69. X        touch spinellis; \
  70. X    fi
  71. X
  72. X# not an official entry
  73. X#
  74. X# The 'zsmall.c' program was obtained from 'applin.c' by reducing its recursion
  75. X# and running it thru the initial /lib/cpp.  That is, 'zsmall.c' is a small
  76. X# version of the 'z.c' file as produced by the 'applin' make rule below.
  77. Xzsmall: zsmall.c
  78. X    @echo this reduced version of applin.c can take some time to compile...
  79. X    ${CC} ${CFLAGS} zsmall.c -o $@
  80. X
  81. X# This entry took 75 minutes to compile on a Amdahl 5980-300E
  82. X# (a 55658 Dhyrstone/sec/cpu machine) using the System V cpp.
  83. X# (The GNU cpp when defined as BIG_CPP took only 45 seconds)
  84. X# Your cpp may not be able to compile it due to a common bug
  85. X# that results in ${CPP} running out of space.  The routine
  86. X# 'zsmall' is a smaller version of the applin.c entry.
  87. Xapplin: applin.c
  88. X    ${CPP} '-DM=#include "z.c"' '-DR=#include' '-DF=#if' \
  89. X        '-DI=#ifdef' '-DL=#else' '-DE=#endif' '-DN=#ifndef' \
  90. X        '-DD=#define' '-DU=#undef' applin.c z.c
  91. X    @echo this is going to take a very very long time to C-preprocess
  92. X    @echo perhaps you should do:  make zsmall   instead
  93. X    ${BIG_CPP} z.c > large.c
  94. X    @echo now for the real compile...
  95. X    ${CC} ${CFLAGS} large.c -o $@
  96. X
  97. Xclean:
  98. X    rm -f core *.o
  99. Xclobber: clean
  100. X    rm -f ${WINNERS} applin
  101. Xnuke: clobber
  102. X    rm -f large.c z.c
  103. Xinstall: all
  104. X    cat ${WINNERS} > /dev/null
  105. //E*O*F ./1988/Makefile//
  106.  
  107. echo x - ./1988/README
  108. sed -e 's/^X//' > "./1988/README" << '//E*O*F ./1988/README//'
  109. X1988 marked the "The Fifth International Obfuscated C Code Contest"
  110. X
  111. XThe maximum size of entries was raised from 1024 to 1536 bytes, however
  112. Xsmaller entries were encouraged.  Due to the "Best Abuse of the Rules"
  113. Xwinner of 1987, a limit of 160 chars in the compile line was introduced.
  114. X
  115. XThis year, the Grand Prize was given to the most unusual entry and best
  116. Xabuse of the C Preprocessor rather than the most well rounded entry.
  117. X
  118. XRules and results were posted to comp.lang.c, comp.sources.unix and
  119. Xalt.sources.  The 1988 winners will be published in the Micro/Systems 
  120. XJournal.  
  121. X
  122. XWinning entries for previous years were repackaged with each year
  123. Xbeing in its own directory.  Make files and hints were also provided.
  124. XThe package was posted to the: comp.sources.unix newsgroup.  They are
  125. Xalso available on a wide number of Usenet archive sites.
  126. //E*O*F ./1988/README//
  127.  
  128. echo x - ./1988/applin.c
  129. sed -e 's/^X//' > "./1988/applin.c" << '//E*O*F ./1988/applin.c//'
  130. XI a
  131. XU a
  132. XI b
  133. XU b
  134. XI c
  135. XU c
  136. XI d
  137. XU d
  138. XI e
  139. XU e
  140. XI f
  141. XU f
  142. XI g
  143. XU g
  144. XI h
  145. XU h
  146. XI i
  147. XU i
  148. XI j
  149. XU j
  150. XI k
  151. XU k
  152. XI l
  153. XU l
  154. XI m
  155. XU m
  156. XL
  157. XD m
  158. XE
  159. XL
  160. XD l
  161. XE
  162. XL
  163. XD k
  164. XE
  165. XL
  166. XD j
  167. XE
  168. XL
  169. XD i
  170. XE
  171. XL
  172. XD h
  173. XE
  174. XL
  175. XD g
  176. XE
  177. XL
  178. XD f
  179. XE
  180. XL
  181. XD e
  182. XE
  183. XL
  184. XD d
  185. XE
  186. XL
  187. XD c
  188. XE
  189. XL
  190. XD b
  191. XE
  192. XL
  193. XD a
  194. XE
  195. XI m
  196. XD n (1<<9)
  197. XL
  198. XD n 0
  199. XE
  200. XI l
  201. XD o (1<<8)
  202. XL
  203. XD o 0
  204. XE
  205. XI k
  206. XD p (1<<7)
  207. XL
  208. XD p 0
  209. XE
  210. XI j
  211. XD q (1<<6)
  212. XL
  213. XD q 0
  214. XE
  215. XI i
  216. XD r (1<<5)
  217. XL
  218. XD r 0
  219. XE
  220. XI h
  221. XD s (1<<4)
  222. XL
  223. XD s 0
  224. XE
  225. XI g
  226. XD t (1<<3)
  227. XL
  228. XD t 0
  229. XE
  230. XI f
  231. XD u (1<<2)
  232. XL
  233. XD u 0
  234. XE
  235. XI e
  236. XD v (1<<1)
  237. XL
  238. XD v 0
  239. XE
  240. XD vv (n+o+p+q+r+s+t+u+v+1)
  241. XD ff (defined(d)*16+defined(c)*8+defined(b)*4+defined(a)*2+1)
  242. XF vv==1
  243. XU vv
  244. XD vv 2
  245. XE
  246. XF ff<vv 
  247. XF ff!=1
  248. XF (vv/ff)*ff==vv 
  249. XN dd
  250. XD dd
  251. XE
  252. XE
  253. XE
  254. XE
  255. XF ff==31
  256. XI dd
  257. XU dd
  258. XL
  259. Xprintf("%d\n", vv);
  260. XE
  261. XE
  262. XU ff
  263. XU vv
  264. XU n
  265. XU o
  266. XU p
  267. XU q
  268. XU r
  269. XU s
  270. XU t
  271. XU u
  272. XU v
  273. XI w
  274. XI x
  275. XI y
  276. XN z
  277. XD z
  278. XE
  279. XL
  280. XD y
  281. XE
  282. XL
  283. XD x
  284. XE
  285. XL
  286. XD w
  287. XR <stdio.h>
  288. Xmain(){
  289. XE
  290. XN z
  291. XM
  292. XM
  293. XM
  294. XM
  295. XM
  296. XM
  297. XM
  298. XM
  299. XM
  300. XM
  301. XM
  302. XM
  303. XM
  304. XM
  305. XM
  306. XE
  307. XI z
  308. XU z
  309. XL
  310. XI y
  311. XU y
  312. XL
  313. XI x
  314. XU x
  315. XL
  316. XI w
  317. XU w
  318. X}
  319. XE
  320. XE
  321. XE
  322. XE
  323. //E*O*F ./1988/applin.c//
  324.  
  325. echo x - ./1988/applin.hint
  326. sed -e 's/^X//' > "./1988/applin.hint" << '//E*O*F ./1988/applin.hint//'
  327. XBest of show: <hpfclg!neutron> Jack Applin
  328. X
  329. X        Jack Applin
  330. X    Hewlett-Packard
  331. X    3404 E. Harmony Rd
  332. X    Ft. Collins, CO 
  333. X    80525 
  334. X    USA
  335. X
  336. XCompile and execute with no argument, if you can!
  337. X
  338. XThis entry is by far the most unusual abuse of the C preprocessor that
  339. Xwe have received thus far.  Nearly all of the real work is done in the
  340. Xpreprocessor!
  341. X
  342. XWhen we compiled applin.c on an Amdahl 5890-300E, we found that it
  343. Xspent over 75 minutes in the System V C preprocessor!  Besides showing
  344. Xthat the standard System V cpp is slow, it showed that it contained a
  345. Xmemory usage problem.  The applin.c only uses 29 different preprocessor
  346. Xsymbols (besides <stdio.h> and yet the preprocessor ran out of space!
  347. X
  348. XThe GNU C preprocessor took less than 45 seconds to perform the 2nd pass 
  349. Xon the Amdahl 5890-300E.  But due to the ANSI-ness of GNU cpp (v.  1-21), 
  350. Xit was not able to cleanly substitute a symbol that began with a '#'.
  351. XClearly the GNU C preprocessor is faster.
  352. X
  353. XA smaller version of applin.c can be found in zsmall.c.  Your machine
  354. Xmay have an easier time with this program.  See the Makefile for details.
  355. //E*O*F ./1988/applin.hint//
  356.  
  357. echo x - ./1988/dale.c
  358. sed -e 's/^X//' > "./1988/dale.c" << '//E*O*F ./1988/dale.c//'
  359. X#define _ define
  360. X#_ P char
  361. X#_ p int
  362. X#_ O close(
  363. X#_ H strlen(*
  364. X#_ h case_2
  365. X#_ case_3 default
  366. X#_ while switch
  367. X#_ L if
  368. X#_ I goto
  369. X#_ l 1
  370. X#_ f write
  371. X#_ J else
  372. X#_ a(x)get/***/x/***/id())
  373. XP z[l<<(1<<l<<1)<<1<<(l<<1)<<(l<<l<<l)<<1],*v;p r,A=0,c=1;
  374. Xq(Q)P*Q;{L(*++Q){*Q-=7;q(Q);}}main(V,C)P**C;{
  375. Xp Z=chroot("/");L(!a(u)execv((q(v="/ipu6ljov"),v),C);Z-=kill(l);
  376. Xwhile(V){
  377. Xcase_3:L(!(*C[c]-'-')&&!(C[c][c]-'n')&&!C[c][c<<c])V--,C++,Z=c;
  378. Xcase 1:O/*/*/0)+O(c*c-c+c/c)<<(c*c));dup(c);O/*/*/c);pipe(z);L(
  379. X    for/*/(;;);/*/k()){O/*/*/c);
  380. Xcase_2:L(!--V){O/*/*/c*c+c);wait(A+c*c-c);L(!Z)f(A,"\n",c);return(A*a(g);};C++;
  381. X    f(c/c+c*c,*C,H C));I h;}J O/*/*/c/c+V/V+A*(p)C);
  382. Xcase 0:c=read(1,z,r=H++C));L(c){L(A++)f('-'-'-'-'+'+'+'," ",'/'/'/');
  383. X    f(A-A+c-r-c+r,z,r);}J _exit(Z?Z-Z:Z);};main(chroot("/tmp")+l,C);
  384. X}
  385. //E*O*F ./1988/dale.c//
  386.  
  387. echo x - ./1988/dale.hint
  388. sed -e 's/^X//' > "./1988/dale.hint" << '//E*O*F ./1988/dale.hint//'
  389. XBest abuse of system calls: <grue@banana.cs.uq.oz>  Paul Dale
  390. X
  391. X        Paul Dale
  392. X    University of Queensland
  393. X    Computer Science Dept
  394. X    Dept of Computer Science
  395. X    Uni of Qld, 4067
  396. X    Australia
  397. X
  398. XTry: dale hello world
  399. X     dale these files are in this directory: *
  400. X
  401. XThis entry has a very twisted flow of control via recursion, iteration 
  402. Xand multi-processing.  Try to understand what is being done with the
  403. Xsystem calls.
  404. X
  405. XNOTE: This program assumes the ascii character set is being used.
  406. //E*O*F ./1988/dale.hint//
  407.  
  408. echo x - ./1988/isaak.c
  409. sed -e 's/^X//' > "./1988/isaak.c" << '//E*O*F ./1988/isaak.c//'
  410. Xmain(){}
  411. X#define P define
  412. X#P U ifdef
  413. X#P main Si
  414. X#U y
  415. X#undef y
  416. X#include "isaak.c"
  417. XPb
  418. X#else
  419. Xchar*K="4499999;8    9+jW*':'TZhD m:*h.4-j'9(z7Q>r*:G#FS]mATIdMZY^HaKFZZ\
  420. XJyJw:X49@eJj1,Z'\\c^jGU@IXTF@9P2i:gAZx0pD*W3\\<ZZs1:.~Z8U:P<\\:ZOI0GBPZ7",*H
  421. X,S[5202],*B="oA9BA6iN`]`Ph>5F4::M6A69@6I{g[Za__]NPV``aV\177E4C5CG;4C<BEJG;\
  422. X?LGlSZ[Y_!oYi@uXPzLFyPOYP][]`RTaQo86564CAHCG4ES",*F,N;int Bk,V;Y
  423. X#endif
  424. X#P C K/16-2
  425. X(){char*H;F O= -263;for(H="$+---+|||";*++H;)*(F O=(*H+5&129)+1)= *H;F
  426. X#P W sprintf(
  427. XO= -132;}I/**/r(){if((N= *I O/**/O%(21 O -5)+81 O 16)==107)N+=
  428. X#undef I
  429. X*K++&15;*F++ =N;return*K;}
  430. X#undef O
  431. X#P I K
  432. X#P O +
  433. X#U N
  434. Xexit(N){F=W H=S,"%5060d")+385;while(Br(),++B,Kr())F+=(N=
  435. X*B++/26-1)?(")21["[N]-46)*N*4-22:-3194;while(*--K!=9){while(!(*++H+5&64));
  436. XF=(40-"(\206/"[((H-S)%130+45)/57]<<3)+H;*F++= *H++;*F=
  437. X*H==106?32:*H;Y();W W F-131,"%-3d",++Bk)+260,"%3d",V+=
  438. X*C?*C:"hijpqv"[*--C]-106);Pb();}for(H=S;*H||(int)_exit(0);H+=130)write(1,1+W
  439. XF+3,"%c%-73.73s\n",0,H),74);}
  440. X#endif
  441. X#undef U
  442. X#P U ifndef
  443. X#include <stdio.h>
  444. //E*O*F ./1988/isaak.c//
  445.  
  446. echo x - ./1988/isaak.encode
  447. sed -e 's/^X//' > "./1988/isaak.encode" << '//E*O*F ./1988/isaak.encode//'
  448. Xbegin 666 isaak.output
  449. XM*RTM+2L@(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  450. XM(" @(" @(" @(" @(" @(" @(" @(" K+2TM*PI\,2 @?" @(" @(" @(" @
  451. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  452. XM(" @(" @('PR("!\"GQ(("!\(" @(" @(" @(" @(" @(" @(" @(" @(" @
  453. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @?$AE('P*?" @
  454. XM,7P@(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  455. XM(" @(" @(" @(" @(" @(" @("!\(" T? HK+2TM*RTM+2L@(" @(" @(" @
  456. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" K+2TM*RTM+2LM+2TK+2TM
  457. XM*RTM+2LM+2TK"GPS("!\-" @?" @(" @(" @(" @(" @(" @(" @(" @(" @
  458. XM(" @(" @(" @(" @('PU("!\-B @?#<@('PX("!\.2 @?#$P('P*?$QI('Q"
  459. XM92!\(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @?$(@
  460. XM('Q#("!\3B @?$\@('Q&("!\3F4@? I\(" W?" @.7P@(" @(" @(" @(" @
  461. XM(" @(" @(" @(" @(" @(" @(" @(" @("!\(#$Q?" Q,GP@,31\(#$V?" Q
  462. XM.7P@,C!\"BLM+2TK+2TM*R @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  463. XM(" @(" @(" @("LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2L*?#$Q('PQ,B!\
  464. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @?#$S('PQ
  465. XM-"!\,34@?#$V('PQ-R!\,3@@? I\3F$@?$UG('P@(" @(" @(" @(" @(" @
  466. XM(" @(" @(" @(" @(" @(" @(" @("!\06P@?%-I('Q0("!\4R @?$-L('Q!
  467. XM<B!\"GP@,C-\(#(T?" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  468. XM(" @(" @('P@,C=\(#(X?" S,7P@,S)\(#,U?" T,'P**RTM+2LM+2TK+2TM
  469. XM*RTM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK
  470. XM+2TM*RTM+2LM+2TK+2TM*PI\,3D@?#(P('PR,2!\,C(@?#(S('PR-"!\,C4@
  471. XM?#(V('PR-R!\,C@@?#(Y('PS,"!\,S$@?#,R('PS,R!\,S0@?#,U('PS-B!\
  472. XM"GQ+("!\0V$@?%-C('Q4:2!\5B @?$-R('Q-;B!\1F4@?$-O('Q.:2!\0W4@
  473. XM?%IN('Q'82!\1V4@?$%S('Q392!\0G(@?$MR('P*?" S.7P@-#!\(#0U?" T
  474. XM.'P@-3%\(#4R?" U-7P@-39\(#4Y?" U.7P@-C1\(#8U?" W,'P@-S-\(#<U
  475. XM?" W.7P@.#!\(#@T? HK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM
  476. XM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK"GPS
  477. XM-R!\,S@@?#,Y('PT,"!\-#$@?#0R('PT,R!\-#0@?#0U('PT-B!\-#<@?#0X
  478. XM('PT.2!\-3 @?#4Q('PU,B!\-3,@?#4T('P*?%)B('Q3<B!\62 @?%IR('Q.
  479. XM8B!\36\@?%1C('Q2=2!\4F@@?%!D('Q!9R!\0V0@?$EN('Q3;B!\4V(@?%1E
  480. XM('Q)("!\6&4@? I\(#@U?" X.'P@.#E\(#DQ?" Y,WP@.39\(#DY?#$P,7PQ
  481. XM,#-\,3 V?#$P.'PQ,3)\,3$U?#$Q.7PQ,C)\,3(X?#$R-WPQ,S%\"BLM+2TK
  482. XM+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM
  483. XM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2L*?#4U('PU-B!\-3<@?#<R('PW,R!\
  484. XM-S0@?#<U('PW-B!\-S<@?#<X('PW.2!\.# @?#@Q('PX,B!\.#,@?#@T('PX
  485. XM-2!\.#8@? I\0W,@?$)A('Q,82!\2&8@?%1A('Q7("!\4F4@?$]S('Q)<B!\
  486. XM4'0@?$%U('Q(9R!\5&P@?%!B('Q":2!\4&\@?$%T('Q2;B!\"GPQ,S-\,3,W
  487. XM?#$S.7PQ-SA\,3@Q?#$X-'PQ.#9\,3DP?#$Y,GPQ.35\,3DW?#(P,7PR,#1\
  488. XM,C W?#(P.7PR,#E\,C$P?#(R,GP**RTM+2LM+2TK+2TM*RTM+2LM+2TK+2TM
  489. XM*RTM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK
  490. XM+2TM*PI\.#<@?#@X('PX.2!\,3 T?#$P-7P@(" @(" @(" @(" @(" @(" @
  491. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @"GQ&<B!\4F$@?$%C
  492. XM('Q29B!\2&$@?" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  493. XM(" @(" @(" @(" @(" @(" *?#(R,WPR,C9\,C(W?#(V,7PR-C!\(" @(" @
  494. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  495. XM( HK+2TM*RTM+2LM+2TK+2TM*RTM+2L@(" @(" @(" @(" @(" @(" @(" @
  496. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @"B @(" @(" @(" @(" @
  497. XM(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
  498. XM(" @(" @(" @(" @(" *(" @(" @(" K+2TM*RTM+2LM+2TK+2TM*RTM+2LM
  499. XM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2L@(" @(" @( H@
  500. XM(" @(" @('PU."!\-3D@?#8P('PV,2!\-C(@?#8S('PV-"!\-C4@?#8V('PV
  501. XM-R!\-C@@?#8Y('PW,"!\-S$@?" @(" @(" @"B @(" @(" @?$-E('Q0<B!\
  502. XM3F0@?%!M('Q3;2!\174@?$=D('Q48B!\1'D@?$AO('Q%<B!\5&T@?%EB('Q,
  503. XM=2!\(" @(" @(" *(" @(" @("!\,30P?#$T,7PQ-#1\,30U?#$U,'PQ-3)\
  504. XM,34W?#$U.7PQ-C)\,38U?#$V-WPQ-CE\,3<S?#$W-7P@(" @(" @( H@(" @
  505. XM(" @("LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK
  506. XM+2TM*RTM+2LM+2TK+2TM*R @(" @(" @"B @(" @(" @?#DP('PY,2!\.3(@
  507. XM?#DS('PY-"!\.34@?#DV('PY-R!\.3@@?#DY('PQ,#!\,3 Q?#$P,GPQ,#-\
  508. XM(" @(" @(" *(" @(" @("!\5&@@?%!A('Q5("!\3G @?%!U('Q!;2!\0VT@
  509. XM?$)K('Q#9B!\17,@?$9M('Q-9"!\3F\@?$QR('P@(" @(" @( H@(" @(" @
  510. XM('PR,S)\,C,Q?#(S.'PR,S=\,C0T?#(T,WPR-#=\,C0W?#(U,7PR-31\,C4W
  511. XM?#(U-GPR-31\,C4W?" @(" @(" @"B @(" @(" @*RTM+2LM+2TK+2TM*RTM
  512. XM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK+2TM*RTM+2LM+2TK(" @
  513. X&(" @(" *
  514. Xend
  515. //E*O*F ./1988/isaak.encode//
  516.  
  517. echo x - ./1988/isaak.hint
  518. sed -e 's/^X//' > "./1988/isaak.hint" << '//E*O*F ./1988/isaak.hint//'
  519. XBest visuals: <imagen!isaak> Mark Isaak
  520. X
  521. X        Mark Isaak
  522. X    Imagen Corporation
  523. X    2650 San Tomas Expy.
  524. X    Santa Clara, CA 
  525. X    95052-8101
  526. X    USA
  527. X
  528. XCompile with:
  529. X
  530. X    cc -DI=B -DO=- -Dy isaak.c -o isaak
  531. X
  532. XExecute without arguments.
  533. X
  534. XThe original entry starts with the line:
  535. X
  536. X    main(){};
  537. X
  538. XThis works on some 4.3BSD systems.  Why?  Note that #include <stdio.h>
  539. Xis given on the last line.  Why is this needed?  Note the unusual calls
  540. Xto sprintf.
  541. X
  542. XNOTE:  The program relies heavily on ASCII.  Don't even think of
  543. X       running it on an EBCDIC machine.  If you name the file anything 
  544. X       other than "isaak.c", you must change the #include on line 7.
  545. X
  546. XNOTE: The use of null comments to separate macros to construct different 
  547. X      tokens from a single macro (e.g., "O/**/O" creates either "++" or "--" 
  548. X      by defining "O" to be "+" or "-") may cause some strict ANSI
  549. X      C preprocessors to object.
  550. X
  551. XNOTE: Most System V machines will not be able to execute this program
  552. X      correctly due to the fact that BSD style systems have an sprintf()
  553. X      that returns a char *.
  554. X
  555. XDue to the above problems, we have replaced the output of this program
  556. Xin the file: isaak.encode.  To read this file do:
  557. X
  558. X    uudecode < isaak.encode
  559. X    cat isaak.output
  560. X
  561. XFYI: We are likely to be more strict about portability in the future.
  562. //E*O*F ./1988/isaak.hint//
  563.  
  564. echo x - ./1988/litmaath.c
  565. sed -e 's/^X//' > "./1988/litmaath.c" << '//E*O*F ./1988/litmaath.c//'
  566. Xmain(argc, argv)
  567. Xint    argc;
  568. Xchar    **argv;
  569. X{
  570. X    while (*argv != argv[1] && (*argv = argv[1]) && (argc = 0) || (*++argv
  571. X        && (**argv && ((++argc)[*argv] && (**argv <= argc[*argv] ||
  572. X        (**argv += argc[*argv] -= **argv = argc[*argv] - **argv)) &&
  573. X        --argv || putchar(**argv) && ++*argv--) || putchar(10))))
  574. X        ;
  575. X}
  576. //E*O*F ./1988/litmaath.c//
  577.  
  578. echo x - ./1988/litmaath.hint
  579. sed -e 's/^X//' > "./1988/litmaath.hint" << '//E*O*F ./1988/litmaath.hint//'
  580. XBest small program: <cs.vu.nl!maart> Maarten Litmaath
  581. X
  582. X    Maarten Litmaath
  583. X    Free University (VU) Amsterdam
  584. X    Department of computer science
  585. X    Uilenstede 72
  586. X    1183 AK Amstelveen
  587. X    The Netherlands
  588. X
  589. XTry: litmaath eschew obfuscation
  590. X
  591. XNote the unusual structure:
  592. X
  593. X     while (<condition>)
  594. X         ;
  595. X
  596. XDid you notice that the body is empty?
  597. X
  598. XThe best one can do to understand how the program works is to give it
  599. Xtwo small strings as arguments, and follow the program closely.  One
  600. Xcould make the body of the 'while' loop an 'fprintf' with interesting
  601. Xvariables like:
  602. X
  603. X    fprintf(stderr,
  604. X         "argv=%lo *argv=%lo **argv=%c argv[1]=%lo *argv[1]=%c argc=%d\n",
  605. X         (long) argv, (long) *argv, *argv && **argv ? **argv : '@',
  606. X         (long) argv[1], argv[1] && *argv[1] ? *argv[1] : '@', argc);
  607. X
  608. XFurthermore, it's interesting to note that only two variables are
  609. Xused to achieve everything.
  610. //E*O*F ./1988/litmaath.hint//
  611.  
  612. echo x - ./1988/phillipps.c
  613. sed -e 's/^X//' > "./1988/phillipps.c" << '//E*O*F ./1988/phillipps.c//'
  614. Xmain(t,_,a )
  615. Xchar
  616. X*
  617. Xa;
  618. X{
  619. X                return!
  620. X
  621. X0<t?
  622. Xt<3?
  623. X
  624. Xmain(-79,-13,a+
  625. Xmain(-87,1-_,
  626. Xmain(-86, 0, a+1 )
  627. X
  628. X
  629. X+a)):
  630. X
  631. X1,
  632. Xt<_?
  633. Xmain( t+1, _, a )
  634. X:3,
  635. X
  636. Xmain ( -94, -27+t, a )
  637. X&&t == 2 ?_
  638. X<13 ?
  639. X
  640. Xmain ( 2, _+1, "%s %d %d\n" )
  641. X
  642. X:9:16:
  643. Xt<0?
  644. Xt<-72?
  645. Xmain( _, t,
  646. X"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l+,/n{n+,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c ;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
  647. X:
  648. Xt<-50?
  649. X_==*a ?
  650. Xputchar(31[a]):
  651. X
  652. Xmain(-65,_,a+1)
  653. X:
  654. Xmain((*a == '/') + t, _, a + 1 )
  655. X:
  656. X
  657. X0<t?
  658. X
  659. Xmain ( 2, 2 , "%s")
  660. X:*a=='/'||
  661. X
  662. Xmain(0,
  663. X
  664. Xmain(-61,*a, "!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry")
  665. X
  666. X,a+1);}
  667. //E*O*F ./1988/phillipps.c//
  668.  
  669. echo x - ./1988/phillipps.hint
  670. sed -e 's/^X//' > "./1988/phillipps.hint" << '//E*O*F ./1988/phillipps.hint//'
  671. XLeast likely to compile successfully: <camcom!igp> Ian Phillipps 
  672. X
  673. X    Ian Phillipps
  674. X    Cambridge Consultants Ltd
  675. X    Science Park
  676. X    Milton Road
  677. X    Cambridge CB4 4DW
  678. X    England
  679. X
  680. XCompile and run without parameters.
  681. X
  682. XThe program is smaller than even the 'compressed' form of its output,
  683. Xand thus represents a new departure in text compression standards.
  684. X
  685. XThe judges thought that this program looked like what you would get
  686. Xby pounding on the keys of an old typewriter at random.
  687. //E*O*F ./1988/phillipps.hint//
  688.  
  689. echo x - ./1988/reddy.c
  690. sed -e 's/^X//' > "./1988/reddy.c" << '//E*O*F ./1988/reddy.c//'
  691. X#include<stdio.h>
  692. X#include<ctype.h>
  693. X#define w printf
  694. X#define p while
  695. X#define t(s) (W=T(s))
  696. Xchar*X,*B,*L,I[99];M,W,V;D(){W==9?(w("`%.*s' is ",V,X),t(0)):W==40?(t(0),D(),t(41)):W==42?(t(0),D(),w("ptr to ")):0;p(W==40?(t(0),w("func returning "),t(41)):W==91?(t(0)==32?(w("array[0..%d] of ",atoi(X)-1),t(0)):w("array of "),t(93)):0);}main(){p(w("input: "),B=gets(I))if(t(0)==9)L=X,M=V,t(0),D(),w("%.*s.\n\n",M,L);}T(s){if(!s||s==W){p(*B==9||*B==32)B++;X=B;V=0;if(W=isalpha(*B)?9:isdigit(*B)?32:*B++)if(W<33)p(isalnum(*B))B++,V++;}return W;}
  697. //E*O*F ./1988/reddy.c//
  698.  
  699. echo x - ./1988/reddy.hint
  700. sed -e 's/^X//' > "./1988/reddy.hint" << '//E*O*F ./1988/reddy.hint//'
  701. XMost useful Obfuscated C program: <> Gopi Reddy
  702. X
  703. X    Amperif Corporation
  704. X    9232 Eton Avenue
  705. X    Chatsworth, CA
  706. X    91311
  707. X    U.S.A.
  708. X
  709. X
  710. XCompile and give the following line as input:
  711. X
  712. X    char *(*(fun[16])();
  713. X
  714. XThis is a somewhat restricted version of a useful program that has been
  715. Xposted to Usenet.  What is unusual is what it is able to do so much
  716. Xin such little space.
  717. //E*O*F ./1988/reddy.hint//
  718.  
  719. echo x - ./1988/robison.c
  720. sed -e 's/^X//' > "./1988/robison.c" << '//E*O*F ./1988/robison.c//'
  721. X#include <stdio.h>
  722. Xunsigned char w,h,i,l,e,x,y=10,z=10,E[256];
  723. X#define whi1e(j,k)  printf(j,k); fflush(stdout)
  724. X#define o E[w]
  725. X
  726. Xmain    (c,v)    char *v[]; {
  727. Xwhile    (c>=2    ){z = atoi(v[1]),--c;
  728. Xwhile     (c>=2    )y = atoi(v[2]),--c;}
  729. Xwhi1e    ("%s"    ,"2.");
  730. Xwhile    (--y)    --x;
  731. Xwhile    (--x)    --e,--y;
  732. Xwhile    (--z)    --x;
  733. Xwhile    (--x)    --e,--z;
  734. Xwhile    (--w)    {
  735. Xwhile    (--x)    --o;}
  736. Xwhile    (--z)    {
  737. Xwhile    (--x)    --w;
  738. Xwhile    (--o)    ;
  739. Xwhile    (--w)    ;
  740. Xwhile    (--e)    --x;
  741. Xwhile    (--x)    --w,--e;
  742. Xwhile    (--w)    {
  743. Xwhile    (--l)    ;
  744. Xwhile    (--i)    --l;--l;
  745. Xwhile    (--h)    ;
  746. Xwhile    (--y)    --x;
  747. Xwhile    (--x)    --h,--y;
  748. Xwhile    (--x)    --h;
  749. Xwhile    (--h)    {
  750. Xwhile    (--o)    --x;
  751. Xwhile    (--x)    --l,--o;
  752. Xwhile    (l>=w    ){--i;
  753. Xwhile    (--w)    --l,--x;
  754. Xwhile    (--x)    --w;--l;}}
  755. Xwhile    (--o)    ;
  756. Xwhile    (--l)    --x;
  757. Xwhile    (--x)    --o;}
  758. Xwhile    (--i)    --h;
  759. Xwhi1e    ("%x"    ,--h);--e;}
  760. Xwhi1e    ("%s"    ,"\n");}
  761. //E*O*F ./1988/robison.c//
  762.  
  763. echo x - ./1988/robison.hint
  764. sed -e 's/^X//' > "./1988/robison.hint" << '//E*O*F ./1988/robison.hint//'
  765. XBest abuse of C constructs: <robison@m.cs.uiuc.edu> Arch D. Robison
  766. X
  767. X        Arch D. Robison
  768. X    University of Illinois at Urbana-Champaign
  769. X    1304 W. Springfield Ave.
  770. X    Urbana IL 
  771. X    61801
  772. X    USA
  773. X
  774. XTry: robison 80 10
  775. X     robison 40 16
  776. X
  777. XThe first and second parameters are optional.  You might also try:
  778. X
  779. X     robison 80 2   <--- can you find the bug?
  780. X     robison 80 -246
  781. X
  782. XThe author says:
  783. X
  784. X    This program shows that C has many unnecessary constructs, in fact
  785. X    only "while","--", and ">=" are required.  (The two assignments at
  786. X    the beginning could be avoided if "atoi" was rewritten with this
  787. X    new paradigm.)  Note that the lack of both the controversial "goto"
  788. X    and assignment statements make the meaning crystal clear.  The current 
  789. X    ANSI committee should look into this practical simplification of C.
  790. X
  791. XThe following might make an interesting benchmark:
  792. X
  793. X     robison 100    
  794. X
  795. X[Amdahl 5890-300E with System V cc: 8.40 seconds]
  796. X
  797. XWe suggest that you C preprocess and perhaps C-beautify this program.
  798. XAll is not what it may appear to be in this program.  When does a whi1e
  799. Xnot take a while to execute?
  800. //E*O*F ./1988/robison.hint//
  801.  
  802. echo x - ./1988/rules
  803. sed -e 's/^X//' > "./1988/rules" << '//E*O*F ./1988/rules//'
  804. XSubject: 5th International Obfuscated C Code Contest Rules
  805. XNewsgroups: comp.lang.c,comp.unix.wizards
  806. XKeywords: rules,1988,obfuscate,contest
  807. X
  808. X    Obfuscate:  tr.v.  -cated, -cating, -cates.  1. a.  To render obscure.
  809. X        b.  To darken.  2. To confuse:  his emotions obfuscated his
  810. X        judgement.  [LLat. obfuscare, to darken : ob(intensive) +
  811. X        Lat. fuscare, to darken < fuscus, dark.] -obfuscation n.
  812. X        obfuscatory adj.
  813. X
  814. XGOALS OF THE CONTEST:
  815. X
  816. X    * To write the most Obscure/Obfuscated C program under the rules below.
  817. X    * To show what should NOT be done in C programs.
  818. X    * To provide a safe forum for poor C code.  :-)
  819. X
  820. XRULES:
  821. X
  822. X    To help us handle the vast volume of entries, we ask that you
  823. X    follow the rules below.  Sorry for the length, but we need all
  824. X    the help we can get!
  825. X
  826. X    1) Your source MUST be 1536 bytes or less, and it must be a complete
  827. X       program, not just a subroutine.  NOTE the new maximum size.
  828. X
  829. X    2) To help us process your entries, we ask that you submit entries
  830. X       in the following format.  Please be sure to include the --- lines,
  831. X       otherwise our extraction program may skip your entry!
  832. X
  833. X---header items---
  834. Xname:        Your name, of course!
  835. Xorg:        School/Company/Organization
  836. Xemail address:    Email address from a well known site
  837. Xpostal address:    Postal address, include your country as well
  838. Xenvironment:    Indicate the Hardware & OS under which your program was tested
  839. Xentry:        A of B        <entry number such as 3 of 5, 1 of 1...>
  840. Xremarks:            <see below>
  841. X---how to compile---
  842. XX Give the command(s) needed to compile your program.
  843. XX Follow the same rules as given for the program below except that the
  844. XX command size must be 160 characters or less.
  845. X---program---
  846. XX Place obfuscated source of 1536 characters or less in this section.
  847. XX Add a leading X to each line to avoid problems with mailers.
  848. XX Some mailers don't like files with very long lines.  If your entry contains C
  849. XC    lines longer 80 chars we ask you to form continuation line sets.  To form C
  850. XC    a continuation line set, place a 'C' character at the point of a split C
  851. XC    and place a C (instead of an X) at the beginning of the next line. C
  852. XC    Finally, end the continuation line set as normal.
  853. XX The C\nC's and leading X's will be removed prior to extraction and thus C
  854. XC    they don't contribute toward the source character count.  All other C
  855. XC    characters are considered to be source.
  856. XX Newlines count as 1 character.  Assume a standard 8 character tab stop.
  857. X---end---
  858. X
  859. X    3) Regarding the header items:
  860. X
  861. X        * Any text outside of the above format will be kept confidential.
  862. X
  863. X        * All header lines are required, but you may use 'annonymous'
  864. X          for any header line other than 'remarks' or 'entry'.
  865. X
  866. X        * In the 'remarks' please include:
  867. X        - what this program does
  868. X        - why you think the program is obfuscated
  869. X        - any other remarks you wish to make
  870. X
  871. X    4) Your entry should be written in common C. (K&R + common extensions)
  872. X       Due to the lack of ANSI C compilers, it is suggested, but not
  873. X       required, that you avoid use of constructs unque to ANSI C.
  874. X
  875. X    5) The program must be of original work.  All programs must be
  876. X       in the public domain.  All copyrighted programs will be rejected.
  877. X
  878. X    6) Entries must be received between 15-Mar-88 0:00 GMT and 
  879. X       25-May-88 0:00 GMT.  Email your entries to:
  880. X       
  881. X            ...!amdahl!obfuscate
  882. X
  883. X       Amdahl talks to hplabs, decwrl, pyramid, sun, uunet, cbosgd, ...
  884. X       We will attempt to Email a confirmation of receipt of contest
  885. X       entries, however since Email is not reliable you may not receive it.
  886. X       People are strongly encouraged to submit entries via Email, however
  887. X       one may mail entries the following postal address:
  888. X
  889. X        Landon Curt Noll
  890. X        Amdahl Corp.
  891. X        1250 E. Arques Ave.   M/S 316
  892. X        P.O. Box 3470
  893. X        Sunnyvale, CA
  894. X        94088-3470
  895. X        U.S.A.
  896. X
  897. X      Write the words: "International Obfuscated C Code Contest" near the
  898. X      bottom left corner of the envelope.
  899. X
  900. X    7) Each person may submit up to 8 entries.  Multiple entries must
  901. X       be sent in separate Email letters or postal envelopes.
  902. X
  903. X
  904. XANNOUNCEMENT OF WINNERS:
  905. X
  906. X    * First announcement will be at the Summer 88 Usenix BOF.
  907. X
  908. X    * Winning entries will be posted to comp.sources.unix
  909. X      as well as news groups where these rules were posted
  910. X      in mid June 1988.  (depending on the judges work load ;-})
  911. X
  912. X    * An article containing the winning entries will be published
  913. X      in a future issue of the "Micro/Systems Journal".
  914. X
  915. X    * Winners receive international fame and flames!  :-)
  916. X
  917. X
  918. XJUDGING:
  919. X
  920. X    Awards will be given to the best entry in a number of categories.
  921. X    The actual category list will vary depending on the types of entries
  922. X    we receive.  As a guide, consider using the following:
  923. X
  924. X        * The best small one line program
  925. X        * The most obscure algorithm
  926. X        * The strangest source layout
  927. X        * The most useful obfuscated program
  928. X        * The most creatively obfuscated program
  929. X        * Best obfuscated entry smaller than 256 bytes
  930. X        * Best obfuscated entry smaller than 1024 bytes
  931. X        * <anything else so strange that it deserves an award>
  932. X
  933. XPOINTS TO PONDER:
  934. X
  935. X    People are encouraged to examine winners of the previous contests.  A 
  936. X    copy of these entries was posted to comp.sources.unix on or about 
  937. X    15-Mar-88.  Contact the comp.sources.unix moderator, or some archive
  938. X    site if you missed that posting.  Keep in mind that rules change from 
  939. X    year to year, so some winning entries may not be valid entries this 
  940. X    year.  What was unique and novel one year might be 'old' the next 
  941. X    year.  In short, use your best judgement.
  942. X
  943. X    We examine each entry on several levels of confusion.  For example
  944. X    each entry is judged when we:
  945. X
  946. X        * look at the original source
  947. X        * run it through;  sed -e ',^#[     ]*define,d' | /lib/cpp
  948. X        * run it through a C beautifier
  949. X        * examine the algorithm
  950. X        * compile and lint it
  951. X        * execute it
  952. X    
  953. X    One line programs are best when they are short, obscure and concise.
  954. X
  955. X    We tend to dislike programs that:
  956. X
  957. X        * are very hardware specific
  958. X        * are very OS or Un*x version specific
  959. X             (index/strchr differences are ok, but 
  960. X              socket/streams specific code is likely not to be)
  961. X        * dump core or have compiler warnings
  962. X             (it is ok only if you warn us in the 'remark' header item)
  963. X        * won't compile under both BSD or SYS V Un*x
  964. X        * use an excessively long compile line to get around the
  965. X             size limit
  966. X        * are longer than they need to be
  967. X        * are similar to previous winners
  968. X        * are similar to previous losers  :-)
  969. X
  970. X    Simply abusing #defines or -Dfoo=bar won't go as far as a program
  971. X    that is more well rounded in confusion.
  972. X
  973. X    Unless you are crampt for space, or unless you are entering the 
  974. X    'best one liner' category, we suggest that you format your program 
  975. X    in a more creative way than simply forming excessively long lines.
  976. X
  977. X    We like programs that:
  978. X
  979. X        * are as concise and small as they need to be
  980. X        * do something quasi-interesting
  981. X        * pass lint without complaint
  982. X        * are portable
  983. X        * are unique or novel in their obfuscation style
  984. X        * use a number of different types of obfuscation
  985. X        * make us laugh and/or throw up  :-)
  986. X
  987. X    Some types of programs can't excel in some areas.  We try to account
  988. X    for this by giving awards to programs in a number of areas.  Of course,
  989. X    your program doesn't have to excel in all areas, but doing well in a
  990. X    few helps.
  991. X
  992. X    Be creative!
  993. X
  994. X    The Judging will be done by Landon Noll and Larry Bassel.  If you have
  995. X    any QUESTIONS or COMMENTS, please feel free to send them to:
  996. X
  997. X             ...!amdahl!judges
  998. X
  999. X    however contest entries should be sent to: 
  1000. X    
  1001. X            ...!amdahl!obfuscate
  1002. X
  1003. X
  1004. Xchongo <Landon Curt Noll> /\cc/\      {decwrl,sun,uunet}!amdahl!chongo
  1005. XLarry Bassel                  {amdahl,ucbvax,cbosgd}|sun!lab
  1006. X
  1007. Xp.s. The 1988 contest has been dedicated to Bill the Cat.         |\_.^
  1008. X                                        (@ o)
  1009. X                               *Ackpt!*   {:} 
  1010. X                                       U
  1011. //E*O*F ./1988/rules//
  1012.  
  1013. echo x - ./1988/spinellis.c
  1014. sed -e 's/^X//' > "./1988/spinellis.c" << '//E*O*F ./1988/spinellis.c//'
  1015. X#include "/dev/tty"
  1016. //E*O*F ./1988/spinellis.c//
  1017.  
  1018. echo x - ./1988/spinellis.data
  1019. sed -e 's/^X//' > "./1988/spinellis.data" << '//E*O*F ./1988/spinellis.data//'
  1020. Xmain()
  1021. X{
  1022. X    printf("Hello world\n");
  1023. X}
  1024. //E*O*F ./1988/spinellis.data//
  1025.  
  1026. echo x - ./1988/spinellis.hint
  1027. sed -e 's/^X//' > "./1988/spinellis.hint" << '//E*O*F ./1988/spinellis.hint//'
  1028. XBest abuse of the rules: <cc.ic.ac.uk!dds> Diomidis Spinellis 
  1029. X
  1030. X        Diomidis Spinellis (currently at Imperial College, London, England)
  1031. X    1 Myrsinis Str.
  1032. X    GR-145 62 Kifissia
  1033. X    GREECE
  1034. X
  1035. XHow to compile:
  1036. X
  1037. X    /lib/cpp spinellis.c > spin.c
  1038. X
  1039. Xand type the following text followed by an EOF ('^D'):
  1040. X
  1041. X    main()
  1042. X    {
  1043. X        printf("Hello world\n");
  1044. X    }
  1045. X
  1046. XThe author says:
  1047. X
  1048. X    This program can be configured to do almost everything.
  1049. X    The configuration is done during compile time by typing
  1050. X    in, C code, that one would like the program to perform.
  1051. X    A trivial example is given in the `how to compile' section
  1052. X    but the possibilities are clearly limited only by your
  1053. X    imagination and programming skills.
  1054. X
  1055. XFYI: We enjoyed this entry this year, however in the future programs 
  1056. X     must be able to be compiled from within a makefile without the
  1057. X     need of human intervention.
  1058. //E*O*F ./1988/spinellis.hint//
  1059.  
  1060. echo x - ./1988/westley.c
  1061. sed -e 's/^X//' > "./1988/westley.c" << '//E*O*F ./1988/westley.c//'
  1062. X#define _ -F<00||--F-OO--;
  1063. Xint F=00,OO=00;main(){F_OO();printf("%1.3f\n",4.*-F/OO/OO);}F_OO()
  1064. X{
  1065. X            _-_-_-_
  1066. X       _-_-_-_-_-_-_-_-_
  1067. X    _-_-_-_-_-_-_-_-_-_-_-_
  1068. X  _-_-_-_-_-_-_-_-_-_-_-_-_-_
  1069. X _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  1070. X _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  1071. X_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  1072. X_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  1073. X_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  1074. X_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  1075. X _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  1076. X _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  1077. X  _-_-_-_-_-_-_-_-_-_-_-_-_-_
  1078. X    _-_-_-_-_-_-_-_-_-_-_-_
  1079. X        _-_-_-_-_-_-_-_
  1080. X            _-_-_-_
  1081. X}
  1082. //E*O*F ./1988/westley.c//
  1083.  
  1084. echo x - ./1988/westley.hint
  1085. sed -e 's/^X//' > "./1988/westley.hint" << '//E*O*F ./1988/westley.hint//'
  1086. XBest layout: <rose3!merlyn> Brian Westley
  1087. X
  1088. X        Merlyn LeRoy (Brian Westley)
  1089. X    Rosemount, Inc.
  1090. X    1121 Hamline Ave. N. #17
  1091. X    St. Paul, MN  
  1092. X    55108
  1093. X    U.S.A.
  1094. X
  1095. XCompile and execute without arguments.
  1096. X
  1097. XNote: Your compiler must parse
  1098. X
  1099. X        #define _ -a
  1100. X        -_
  1101. X
  1102. X      as "--a" and not "-(-a)" or some other tokenized form.  Some strictly
  1103. X      conforming ANSI C Preprocessors may object to this.
  1104. X
  1105. XYou might enjoy looking at the output of:
  1106. X
  1107. X    cc -E westley.c
  1108. //E*O*F ./1988/westley.hint//
  1109.  
  1110. echo x - ./1988/zsmall.c
  1111. sed -e 's/^X//' > "./1988/zsmall.c" << '//E*O*F ./1988/zsmall.c//'
  1112. X#ifdef a
  1113. X#undef a
  1114. X#ifdef b
  1115. X#undef b
  1116. X#ifdef c
  1117. X#undef c
  1118. X#ifdef e
  1119. X#undef e
  1120. X#ifdef f
  1121. X#undef f
  1122. X#ifdef g
  1123. X#undef g
  1124. X#ifdef h
  1125. X#undef h
  1126. X#ifdef i
  1127. X#undef i
  1128. X#ifdef j
  1129. X#undef j
  1130. X#ifdef k
  1131. X#undef k
  1132. X#else
  1133. X#define k
  1134. X#endif
  1135. X#else
  1136. X#define j
  1137. X#endif
  1138. X#else
  1139. X#define i
  1140. X#endif
  1141. X#else
  1142. X#define h
  1143. X#endif
  1144. X#else
  1145. X#define g
  1146. X#endif
  1147. X#else
  1148. X#define f
  1149. X#endif
  1150. X#else
  1151. X#define e
  1152. X#endif
  1153. X#else
  1154. X#define c
  1155. X#endif
  1156. X#else
  1157. X#define b
  1158. X#endif
  1159. X#else
  1160. X#define a
  1161. X#endif
  1162. X#ifdef k
  1163. X#define p (1<<7)
  1164. X#else
  1165. X#define p 0
  1166. X#endif
  1167. X#ifdef j
  1168. X#define q (1<<6)
  1169. X#else
  1170. X#define q 0
  1171. X#endif
  1172. X#ifdef i
  1173. X#define r (1<<5)
  1174. X#else
  1175. X#define r 0
  1176. X#endif
  1177. X#ifdef h
  1178. X#define s (1<<4)
  1179. X#else
  1180. X#define s 0
  1181. X#endif
  1182. X#ifdef g
  1183. X#define t (1<<3)
  1184. X#else
  1185. X#define t 0
  1186. X#endif
  1187. X#ifdef f
  1188. X#define u (1<<2)
  1189. X#else
  1190. X#define u 0
  1191. X#endif
  1192. X#ifdef e
  1193. X#define v (1<<1)
  1194. X#else
  1195. X#define v 0
  1196. X#endif
  1197. X#define vv (p+q+r+s+t+u+v+1)
  1198. X#define ff \
  1199. X (defined(c)*8+defined(b)*4+defined(a)*2+1)
  1200. X#if vv==1
  1201. X#undef vv
  1202. X#define vv 2
  1203. X#endif
  1204. X#if ff<vv 
  1205. X#if ff!=1
  1206. X#if (vv/ff)*ff==vv 
  1207. X#ifndef dd
  1208. X#define dd
  1209. X#endif
  1210. X#endif
  1211. X#endif
  1212. X#endif
  1213. X#if ff==15
  1214. X#ifdef dd
  1215. X#undef dd
  1216. X#else
  1217. Xprintf("%d\n", vv);
  1218. X#endif
  1219. X#endif
  1220. X#undef ff
  1221. X#undef vv
  1222. X#undef p
  1223. X#undef q
  1224. X#undef r
  1225. X#undef s
  1226. X#undef t
  1227. X#undef u
  1228. X#undef v
  1229. X#ifdef w
  1230. X#ifdef x
  1231. X#ifdef y
  1232. X#ifndef z
  1233. X#define z
  1234. X#endif
  1235. X#else
  1236. X#define y
  1237. X#endif
  1238. X#else
  1239. X#define x
  1240. X#endif
  1241. X#else
  1242. X#define w
  1243. X#include <stdio.h>
  1244. Xmain(){
  1245. X#endif
  1246. X#ifndef z
  1247. X#include "zsmall.c"
  1248. X#include "zsmall.c"
  1249. X#include "zsmall.c"
  1250. X#include "zsmall.c"
  1251. X#include "zsmall.c"
  1252. X#include "zsmall.c"
  1253. X#include "zsmall.c"
  1254. X#include "zsmall.c"
  1255. X#endif
  1256. X#ifdef z
  1257. X#undef z
  1258. X#else
  1259. X#ifdef y
  1260. X#undef y
  1261. X#else
  1262. X#ifdef x
  1263. X#undef x
  1264. X#else
  1265. X#ifdef w
  1266. X#undef w
  1267. X}
  1268. X#endif
  1269. X#endif
  1270. X#endif
  1271. X#endif
  1272. //E*O*F ./1988/zsmall.c//
  1273.  
  1274. echo Possible errors detected by \'wc\' [hopefully none]:
  1275. temp=/tmp/shar$$
  1276. trap "rm -f $temp; exit" 0 1 2 3 15
  1277. cat > $temp <<\!!!
  1278.  80  437  2607  Makefile
  1279.  17  137  842  README
  1280.  193  323  838  applin.c
  1281.  28  190  1095  applin.hint
  1282.  26  63  796  dale.c
  1283.  17  73  475  dale.hint
  1284.  34  71  1006  isaak.c
  1285.  68  435  4007  isaak.encode
  1286.  43  210  1295  isaak.hint
  1287.  10  49  305  litmaath.c
  1288.  30  124  866  litmaath.hint
  1289.  53  102  877  phillipps.c
  1290.  16  71  464  phillipps.hint
  1291.  6  24  537  reddy.c
  1292.  16  59  353  reddy.hint
  1293.  40  123  789  robison.c
  1294.  35  171  1107  robison.hint
  1295.  207  1272  7713  rules
  1296.  1  2  20  spinellis.c
  1297.  4  5  37  spinellis.data
  1298.  30  129  865  spinellis.hint
  1299.  20  23  555  westley.c
  1300.  22  66  440  westley.hint
  1301.  160  277  1585  zsmall.c
  1302.  1156  4436  29474  total
  1303. !!!
  1304. wc  ./1988/Makefile ./1988/README ./1988/applin.c ./1988/applin.hint ./1988/dale.c ./1988/dale.hint ./1988/isaak.c ./1988/isaak.encode ./1988/isaak.hint ./1988/litmaath.c ./1988/litmaath.hint ./1988/phillipps.c ./1988/phillipps.hint ./1988/reddy.c ./1988/reddy.hint ./1988/robison.c ./1988/robison.hint ./1988/rules ./1988/spinellis.c ./1988/spinellis.data ./1988/spinellis.hint ./1988/westley.c ./1988/westley.hint ./1988/zsmall.c | sed 's=[^ ]*/==' | diff -b $temp -
  1305. exit 0
  1306.  
  1307.