home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume32 / iocc1992 / part03 < prev    next >
Encoding:
Text File  |  1992-09-10  |  54.3 KB  |  1,780 lines

  1. Newsgroups: comp.sources.misc
  2. From: chongo@toad.com (Landon Curt Noll)
  3. Subject:  v32i030:  ioccc.1992 - 1992 International Obfuscated C Code Contest winners, Part03/05
  4. Message-ID: <1992Sep10.154442.27179@sparky.imd.sterling.com>
  5. X-Md4-Signature: 0a668225acf2082a538a528eaf25d394
  6. Date: Thu, 10 Sep 1992 15:44:42 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: chongo@toad.com (Landon Curt Noll)
  10. Posting-number: Volume 32, Issue 30
  11. Archive-name: ioccc.1992/part03
  12. Environment: C
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then feed it
  16. # into a shell via "sh file" or similar.  To overwrite existing files,
  17. # type "sh file -c".
  18. # Contents:  1992/README 1992/adrian.hint 1992/adrian.orig.c
  19. #   1992/albert.orig.c 1992/imc.hint 1992/nathan.hint 1992/third
  20. #   1992/vern.hint 1992/vern.orig.c 1992/westley.hint
  21. # Wrapped by kent@sparky on Thu Sep 10 10:21:21 1992
  22. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  23. echo If this archive is complete, you will see the following message:
  24. echo '          "shar: End of archive 3 (of 5)."'
  25. if test -f '1992/README' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'1992/README'\"
  27. else
  28.   echo shar: Extracting \"'1992/README'\" \(3693 characters\)
  29.   sed "s/^X//" >'1992/README' <<'END_OF_FILE'
  30. X1992 marked the "The Ninth International Obfuscated C Code Contest"
  31. X
  32. XUse make to compile entries.  It is possible that on BSD or non-unix
  33. Xsystems the makefile needs to be changed.  See the Makefile for details.
  34. X
  35. XLook at the source and try to figure out what the programs do, and run
  36. Xthem with various inputs.  If you want to, look at the hints files for
  37. Xspoilers - this year we included most of the information included
  38. Xby the submitters.
  39. X
  40. XRead over the makefile for compile/build issues.  Your system may
  41. Xrequire certain changes (add or remove a library, add or remove a
  42. X#define).  A number of compilers had problems optimizing certain
  43. Xentries.  Some compilers do optimize, but the resulting program
  44. Xdoes not work.  By default we have left off -O from compile lines.  
  45. XYou might want to add -O back, or add it back for certain entries
  46. Xwhere performance is important.
  47. X
  48. XThis year marked an all time high for number of entries as well as the
  49. Xquality of entries.  Nearly twice the usual number of entries made it
  50. Xto the final judging rounds.  Even when we raised the standards for
  51. Xwinning, we still wound giving out a few more awards than in other
  52. Xyears.  The new size rules size probably contributed to the overall
  53. Xhigh quality.
  54. X
  55. XFYI: By tradition, we do not record the count the number entries,
  56. X     nor do we give our our guess as to the number of entries 
  57. X     received.  For folks who wonder, we can say that we consumed 
  58. X     about 2000 pages of output (printing between 2 and 4 normal 
  59. X     pages per side) during the judging process this year.
  60. X
  61. XThe new instructions for submitting entries worked well - we were
  62. Xable to write scripts to unpack them and eliminate duplicates.
  63. X
  64. XAs promised last year, we accepted programs that made use of the X
  65. Xlibraries for the first time.  We now consider ANSI C compilers to be
  66. Xthe "standard" version that the entries were compiled with.
  67. X
  68. XName and address information are separated from the actual program
  69. Xprior to judging.  This eliminates any chance that we would bias our
  70. Xjudging for/against any person or group.  In the end, we are surprised
  71. Xas you are to see who as won.  Even so, it is worth noting that
  72. XBrian Westley has submitted a winning entry for the past 6 years!
  73. X
  74. X
  75. XA few notes regarding future contests:
  76. X
  77. XWe did not give awards to some traditional contest categories such as
  78. X"Best Layout".  We felt that to do so would deny awards to more
  79. Xdeserving entries.  These categories have not been eliminated.  We will
  80. Xlikely be awarding them in future years.
  81. X
  82. XWe received a few entries whose instructions were rot13'd.  While
  83. Xnothing was said about this in the rules, we found that it made the 
  84. Xjudging process a little harder, so we may request that this not
  85. Xbe done this in the future.
  86. X
  87. XSome thought has been given to a separate obfuscated perl contest.
  88. XWatch comp.lang.perl for details!
  89. X
  90. XBe sure to wait until the 1993 rules are posted before submitting entries.  
  91. XWe may fine tune the rules to reflect the some ideas above.
  92. X
  93. XPlease send us comments and suggestions what we have expressed above.
  94. XAlso include anything else that you would like to see in future contests.
  95. XSend such email to:
  96. X
  97. X    ...!{sun,pacbell,uunet,pyramid}!hoptoad!judges
  98. X    judges@toad.com
  99. X
  100. X
  101. XIf you use, distribute or publish these entries in some way, please drop
  102. Xus a line.  We enjoy seeing who, where and how the contest is used.
  103. X
  104. XIf you have problems with any of the entries, AND YOU HAVE A FIX, please
  105. XEmail the fix (patch file or the entire changed file) to the above address.
  106. X
  107. XCredits:
  108. X
  109. XWe would like to thank Barbara Frezza for her role as official chef of
  110. Xthe contest.  Landon Noll and Larry Bassel appreciated the opportunity
  111. Xto serve as official taste testers. Yummo!
  112. END_OF_FILE
  113.   if test 3693 -ne `wc -c <'1992/README'`; then
  114.     echo shar: \"'1992/README'\" unpacked with wrong size!
  115.   fi
  116.   # end of '1992/README'
  117. fi
  118. if test -f '1992/adrian.hint' -a "${1}" != "-c" ; then 
  119.   echo shar: Will not clobber existing file \"'1992/adrian.hint'\"
  120. else
  121.   echo shar: Extracting \"'1992/adrian.hint'\" \(7292 characters\)
  122.   sed "s/^X//" >'1992/adrian.hint' <<'END_OF_FILE'
  123. XMost Educational: <adrian@u.washington.edu> Adrian Mariano
  124. X
  125. X    Adrian Mariano
  126. X    University of Washington
  127. X    2729 72nd Ave SE
  128. X    Mercer Island, WA 98040
  129. X    USA
  130. X
  131. X
  132. XJudges' comments:
  133. X
  134. X    To build:
  135. X    make adrian
  136. X
  137. X    Try:
  138. X    adrian adrian.grep.try < adrian.hint
  139. X    
  140. X    For the slow minded, try:
  141. X    adsleep 32767
  142. X    
  143. X    Once you get past the obfuscation, you have an opportunity to learn
  144. X    about regular expressions and state machines.
  145. X
  146. X    NOTE: Some compilers have had trouble optimizing this entry.
  147. X
  148. X
  149. XSelected notes from the author:
  150. X
  151. X                            ADrian's GREP (adgrep)
  152. X
  153. X    For those confused by the complexity of full-blown egrep style regular
  154. X    expressions, this program offers an alternative.  It implements an
  155. X    equivalent search, using a deterministic finite automaton.
  156. X
  157. X    A deterministic finite automaton consists of a finite set of states,
  158. X    along with transition rules to move from one state to another, an initial
  159. X    state, and a set of accepting states.  The automaton takes a string as
  160. X    input and begins in the start state.  It reads a character of the string
  161. X    and consults the rules for the current state, moving to the new state
  162. X    indicated by the appropriate rule.  This process is repeated until the
  163. X    string is consumed.  If the current state at this point is one of the
  164. X    accepting states, then the string is accepted.
  165. X
  166. X    The deterministic finite automaton is specified as a series of rules for
  167. X    each state:
  168. X
  169. X       <state> chars1 <dest1> chars2 <dest2> ...
  170. X
  171. X    chars1 is a list of characters (only the first 8 are significant) which
  172. X    should trigger a transition to <dest1>.  <dest1> is another state which
  173. X    should have a similar specification somewhere.  A state is accepting if
  174. X    it is specified in square brackets: [final], and state strings are
  175. X    significant to only eight characters.
  176. X
  177. X    Example 1: matches ^abc$
  178. X
  179. X    <q0> a <q1>          The first state to appear is the start state
  180. X    <q1> b <q2>
  181. X    <q2> c [q3]
  182. X    [q3]
  183. X
  184. X    Technically, a deterministic finite automaton should have a rule for each
  185. X    possible input character at each state.  To simplify descriptions of the
  186. X    automata, if no rule is present, the string will not be accepted. Also,
  187. X    the '.' character matches any character if it occurs first in the
  188. X    character list.
  189. X
  190. X
  191. X    Example 2: ^abc
  192. X
  193. X    <q0> a <q1>
  194. X    <q1> b <q2>
  195. X    <q2> c [q3]
  196. X    [q3] . [q3]
  197. X
  198. X
  199. X    Example 3: abc$
  200. X
  201. X    <q0> a <q1> . <q0>
  202. X    <q1> b <q2> a <q1> . <q0>
  203. X    <q2> c [q3] a <q1> . <q0>
  204. X    [q3] . <q1>
  205. X
  206. X
  207. X    Example 4: ^(abc)*$
  208. X
  209. X    [q0] a <q1>
  210. X    <q1> b <q2>
  211. X    <q2> c [q0]
  212. X
  213. X
  214. X    Example 5: ^[ab][cd][ef]$
  215. X
  216. X    <q0> ab <q1>
  217. X    <q1> cd <q2>
  218. X    <q2> ef [q3]
  219. X    [q3]
  220. X
  221. X
  222. X    Example 6: ^(abc|efg)$
  223. X
  224. X    <q0> a <q1> e <q3>
  225. X    <q1> b <q2>
  226. X    <q2> c [q5]
  227. X    <q3> f <q4>
  228. X    <q4> g [q5]
  229. X    [q5]
  230. X
  231. X
  232. X    With the automaton specification in 'filename', invoke the program by
  233. X    typing
  234. X
  235. X                                adgrep 'filename'
  236. X
  237. X    It will read stdin and print out all the lines which the automaton
  238. X    accepts.  If the file cannot be opened, a system error message will
  239. X    be printed.  If the input contains errors, then an error message along
  240. X    with the number of the offending line will be printed to stderr.  The 
  241. X    number of rules for each state is limited to 17.  If more than 17 rules 
  242. X    are present, you get the error to_many_rules, and the state that was 
  243. X    being processed is printed.  Error no_destination occurs if you specify a 
  244. X    set of characters, but no destination state, and error too_many_states 
  245. X    occurs if your automaton has more than 257 states.
  246. X
  247. X    Running
  248. X                             adgrep from < your_mailbox
  249. X
  250. X    will perform a function similar to that of the unix from command.
  251. X
  252. X    If no filename is specified on the command line, then "adgrep.c" is used
  253. X    as the specification for the automaton.  (This file has been renamed 
  254. X    to adrian.c by the judges.)  In this case, the program will search for 
  255. X    matches to the regular expression:
  256. X
  257. X                        ^.[^|C][^w[Q]*(Q|[w[]c).*|^.[C|]$
  258. X
  259. X    I suggest using adgrep.c as input, and storing the output in adwc.c:
  260. X
  261. X                           adgrep < adgrep.c > adwc.c
  262. X
  263. X    Compiling the new file, mywc.c, yields a clone of the unix wc command. It
  264. X    runs on one file (defaulting to "adgrep.c" if no file is given) and
  265. X    displays the number of lines, words, and bytes in the input file.
  266. X
  267. X
  268. X    Another possibly interesting automaton can be created by slightly
  269. X    adjusting the adgrep.c file.  Change the first line to read
  270. X
  271. X                                 /* . echo| . */
  272. X
  273. X    and repeat the process above
  274. X
  275. X                           adgrep <adgrep.c > adecho.c
  276. X
  277. X    The new file now contains all lines which match
  278. X
  279. X                      ^.[^5|m^]*[m^]([e=p,;]|[^e=+p,;].*)$
  280. X
  281. X    Compile and run.  This is an echo clone.  Note the efficient algorithm
  282. X    employed.
  283. X
  284. X
  285. X    Two other adjustments to the first line also yield useful results. By
  286. X    changing it to
  287. X                                 /* . head; . */
  288. X
  289. X    you can search for matches to
  290. X
  291. X                                  ^.[^W]*W..*$
  292. X
  293. X    By some freak happenstance, lines of adgrep.c which match this regular
  294. X    expression form a unix head command.  It prints the first ten lines of
  295. X    the file specified on the command line (or adgrep.c if no file is
  296. X    specified).
  297. X
  298. X    By setting the first line to
  299. X
  300. X                               /* . basename . */
  301. X
  302. X    a clone of the unix basename command can be unearthed. The automaton will
  303. X    search for
  304. X                                  ^.[^j]*jr.*$
  305. X
  306. X    on standard input.  And the program which results by running adgrep.c
  307. X    through this filter requires two parameters.  The first is meant to be a
  308. X    filename, and the second, an extension.  All leading pathname components
  309. X    are removed from the filename, and the extension is removed if present.
  310. X    The resulting base name is printed to stdout.
  311. X
  312. X    Lastly, by setting the first line to
  313. X
  314. X                                    /* . sleep . */
  315. X
  316. X    you can search for
  317. X
  318. X                        ^.[^(~][^s]*sl.*$
  319. X
  320. X    Filtering adgrep.c through this search yields a clone of the sleep
  321. X    command.  Invoke with a single integer parameter, and it will pause
  322. X    for that many seconds.
  323. X
  324. X    If either adbasename or adsleep is invoked with too few parameters,
  325. X    the program will print the error message:
  326. X                       Segmentation fault (core dumped)
  327. X
  328. X    (The exact text of the above error messages varies from machine to
  329. X    machine.)  The four programs which read from stdin require lines
  330. X    shorter than 999 characters.
  331. X
  332. X    The other info files are adrian.grep.[1-6] which contain the six
  333. X    examples that appear above, and from, which is used to emulate the
  334. X    unix from command.  For reasons of clarity, the name "from" should
  335. X    probably not be changed if possible.  I wouldn't want to be accused of 
  336. X    confusing people by giving the input files weird names.
  337. X
  338. X    If you want to change the default input filename (line 80) you must be
  339. X    careful to choose a name that doesn't match the wrong search patterns,
  340. X    introducing extra lines into one of the programs.
  341. X
  342. X    The program will produce at least one warning and possible several
  343. X    when compiled depending on the compiler.
  344. END_OF_FILE
  345.   if test 7292 -ne `wc -c <'1992/adrian.hint'`; then
  346.     echo shar: \"'1992/adrian.hint'\" unpacked with wrong size!
  347.   fi
  348.   # end of '1992/adrian.hint'
  349. fi
  350. if test -f '1992/adrian.orig.c' -a "${1}" != "-c" ; then 
  351.   echo shar: Will not clobber existing file \"'1992/adrian.orig.c'\"
  352. else
  353.   echo shar: Extracting \"'1992/adrian.orig.c'\" \(2581 characters\)
  354.   sed "s/^X//" >'1992/adrian.orig.c' <<'END_OF_FILE'
  355. X/* . wc . */
  356. X#include<stdio.h>/* Wht majr flwchrt? */
  357. X#include<string.h>/* That mjr flwchrt! */
  358. X#define P 257
  359. X#define G 17
  360. X#define z 8
  361. X#define v(jr) jr
  362. Xint W ,head;
  363. X#define S(W,b,f) strncpy(W,b,f),W[f]=0\
  364. X
  365. X  
  366. Xchar *wcs=" \t\n";
  367. Xstruct{ char X[z+1]; 
  368. X        char f ;
  369. X        int e ; 
  370. X        struct{ char g[z+1];
  371. X                int b ;
  372. X              } w[ G];
  373. X      } o[ P];
  374. Xint L=0,j= -28;
  375. X
  376. X
  377. Xvoid E(int i, int m,char*c)
  378. X{   
  379. X for(; i<43; i+=3) 
  380. X   putc(i["}|uutsrq`_^bji`[Zkediml[PO]a_M__]ISOYIRGTNR"]+i-9,stderr);
  381. X fprintf(stderr,"(%d): %s\n" ,m,c);
  382. X exit(1);
  383. X}
  384. X
  385. X
  386. X
  387. Xint N(int m, char *t)
  388. X{ 
  389. X  int i ;
  390. X  if (strlen ( 
  391. X              t)>z) t[z ]=0;
  392. X  for(i= 0; i< L ; i++) if(
  393. X                           !strcmp (o[ i] . X
  394. X                                             , t))return i;
  395. X  if( L== P)
  396. X             E(0, m, t);
  397. X  S (o[ L] . X , t
  398. X                  ,z);
  399. X  head; W = .1* head;
  400. X  o[L ].f = !( strchr( t,']' )== 0 );
  401. X  o[L ++ ] . e = 0;
  402. X  return L -1 ; }
  403. X
  404. X#define v(x )
  405. X
  406. Xint A(char *R)
  407. X{
  408. X  int c=0, i;
  409. X  while(* R) {
  410. X    i = -1;
  411. X    while(j){
  412. X      if( ++ i==o[ c].e ) return 0;
  413. X      if(o[ 
  414. X           c] .w[i ] .g[0 ] 
  415. X                            =='.' ||strchr (o[ c].w[i] .g ,* R)){
  416. X      c=
  417. X        o[ c ] .w[i].b; break;/*
  418. Xmain(int sl,char *j[]){
  419. X      sleep (~~~~~~~~atoi(j[1])) ;/* . sl
  420. X      sl s l . sl
  421. X      l l ]
  422. X      sl */ }
  423. X    }
  424. X    R++;
  425. X  }
  426. X  return o[ c].f;
  427. X}
  428. X
  429. X
  430. X main(int wc,char *V[]){char Y[999],*s;FILE*W;int m=0,echo,jr,q,wcl=0,wcw=0,wcc=0;
  431. X v(s = V[1]; if (*V=strrchr(s,'/'))s=*V+1;  if(( !strncmp( s + (jr=strlen(s)) -
  432. X  (q=strlen(V[2]) ),V[2],q))&&jr!=q) s[jr-q] = 0;  puts(s); )
  433. X int e,p,C,Q ,basename;
  434. X W= fopen(wc>= 2 ? V[1] : "adgrep.c","rt");
  435. Xecho| m^ e| 5| (int) .8| echo|
  436. Xwc |C ==o[o[C] .e] . 
  437. Xe| e==+p,p; s[o[C] .e ] 
  438. X;
  439. Xwhile( fgets(Y,998,W)) { wcc += strlen(Y); m++;
  440. X     if( s = strtok(Y,wcs)) wcw++;
  441. X     else continue ;
  442. X     C=
  443. X       basename= j +j+*"* . basename" 
  444. X                +j+*"* r ] " + N(m,s) ;
  445. Xwhile( s = strtok(0,wcs)) {
  446. X       if( o[ C ] . e == 
  447. X                         G) E(1 ,m,o[C] .X) ;
  448. X       S(o[C
  449. X             ] .w[o[C ] .e].g,s, z);
  450. X       Q= C ;
  451. X       if(! ( s =strtok ( 0 ,wcs )))wcw --
  452. X       ,E( 2 , m, o[C]
  453. X                   . w[ o[ Q ] .e] . g );
  454. X       e
  455. X         = o[C ] .w[o[C ] .e++ ] .b= N(m,s)
  456. X       ; wcw += 2; }  
  457. X     0&& 
  458. X        W && wcl++
  459. X                  < 10 && printf((W,Y)); }
  460. X   if(j+28) { {
  461. X                ; } printf("%7u%7u%7u\n", wcl , wcw , wcc); }
  462. X   while( gets(Y) ) if(A(Y)) puts(Y);
  463. X   W, jr; }
  464. X
  465. XO(int wc,char**V) {
  466. X--wc && (printf("%s ",*++V), main(wc,V), 1) || printf("\n"); }
  467. X
  468. END_OF_FILE
  469.   if test 2581 -ne `wc -c <'1992/adrian.orig.c'`; then
  470.     echo shar: \"'1992/adrian.orig.c'\" unpacked with wrong size!
  471.   fi
  472.   # end of '1992/adrian.orig.c'
  473. fi
  474. if test -f '1992/albert.orig.c' -a "${1}" != "-c" ; then 
  475.   echo shar: Will not clobber existing file \"'1992/albert.orig.c'\"
  476. else
  477.   echo shar: Extracting \"'1992/albert.orig.c'\" \(3153 characters\)
  478.   sed "s/^X//" >'1992/albert.orig.c' <<'END_OF_FILE'
  479. X#include <stdio.h>
  480. X#include <malloc.h>
  481. X#include <setjmp.h>
  482. X#include <ctype.h>
  483. X#define new(PP) (PP *) malloc(sizeof(PP)) 
  484. Xtypedef struct q {
  485. X    jmp_buf ppp;
  486. X    long qq;
  487. X    struct q *P;
  488. X    struct q *p;
  489. X} 
  490. XPP;
  491. X
  492. XPP *P;
  493. Xint aaaaaa=2;
  494. Xint aaaaaaa=1;
  495. X
  496. Xlong qqq;
  497. X
  498. X
  499. XaaAaaa(aa,aaa)
  500. Xchar *aa;
  501. Xchar *aaa;
  502. X{
  503. X    char aaaa = 0;
  504. X    if ((((( aaa )))))
  505. X    {
  506. X        aaaa = *aa;
  507. X        *aa=0;
  508. X        aa+=strlen(aa+1);
  509. X        P =new(PP);
  510. X        P->P=P;
  511. X        P->p=P;
  512. X    }
  513. X
  514. X    if ((((( !setjmp(P->ppp) ))))) 
  515. X        {
  516. X        if ((((( !isdigit(*aa) )))))
  517. X            longjmp(P->ppp,aaaaaaa);
  518. X        else {
  519. X            P->p->P = new(PP);
  520. X            P->p->P->P = P;
  521. X            P->p->P->p = P->p;
  522. X            P->p = P->p->P;
  523. X
  524. X            P->qq = *aa--;
  525. X            P = P->p;
  526. X            aaAaaa(aa,0);
  527. X        }
  528. X    } else {
  529. X        if ( !aaaa&&!*aa ) 
  530. X           longjmp(P->p->ppp,aaaaaaa);
  531. X
  532. X        if ((((( (P->qq=aaaa)<10     &&!
  533. X                 (isdigit(aaaa))     ||!
  534. X                 (isdigit(*aa)       ||!
  535. X                 *aa                        )))))) 
  536. X        {
  537. X            fprintf(stderr,"Usage %c%s <number>\n",
  538. X            (aaa[0]?7:aaaa),aaa+!aaa[0]);
  539. X            exit(1);
  540. X        }
  541. X    }
  542. X}
  543. X
  544. X
  545. XppPppp(pp,ppp)
  546. XPP **pp, *ppp;
  547. X{
  548. X    int aa;
  549. X    if ((((( !(aa=setjmp(ppp->ppp))||aa==aaaaaa )))))
  550. X    {
  551. X        if ((((( *pp==ppp )))))
  552. X        {
  553. X            ppp = (*pp)->p;
  554. X
  555. X            if ( qqq<47 ) return;
  556. X            if ( ppp->qq!=48 ) return;
  557. X
  558. X            while ( ppp->qq==48 ) 
  559. X            {
  560. X                printf("%ld\n",qqq-45);
  561. X                *pp = ppp;
  562. X                ppp = ppp->p;
  563. X            }
  564. X            qqq -= 1;
  565. X            longjmp(ppp->ppp,aaaaaaa);
  566. X        } else {
  567. X            PP *p;
  568. X
  569. X            ppPppp(pp,ppp->p);
  570. X            for (p=ppp;p!=*pp;p=p->p)
  571. X            {
  572. X                int qq=4;
  573. X                if ((((( qqq<47                            &&
  574. X                         (qq=0,p->qq+=p->p->qq-96)>=48-qqq ||
  575. X                         qqq>46                            &&
  576. X                         (p->qq-=p->p->qq)<0                   ))))) 
  577. X                {
  578. X                    p->qq += qqq+qq;
  579. X                    if ( p->p==P && qqq<=46 )
  580. X                    {
  581. X                        P->p->P = new(PP);
  582. X                        P->p->P->P = P;
  583. X                        P->p->P->p = P->p;
  584. X                        *pp = P = P->p = P->p->P;
  585. X                        P->qq = 48;
  586. X                    }
  587. X
  588. X                    p->p->qq+=qq==0;
  589. X                    p->p->qq-=qq!=0;
  590. X                }
  591. X                else
  592. X                {
  593. X                    p->qq += 48;
  594. X                }
  595. X            }
  596. X            if ( ppp->P==P ) longjmp(ppp->ppp,aaaaaaa);
  597. X        }
  598. X    }
  599. X    else
  600. X    {
  601. X        qqq += 1; 
  602. X
  603. X        while (48==P->qq )
  604. X        {
  605. X            P->P->p = P->p;
  606. X            P = P->p->P = P->P;
  607. X
  608. X        }
  609. X
  610. X        if (ppp!=ppp->p->p )
  611. X            longjmp(ppp->ppp,aaaaaa);
  612. X        else
  613. X        {
  614. X            printf("At most one remains\n");
  615. X            exit(0);
  616. X        }
  617. X    }
  618. X}
  619. X
  620. X
  621. Xmain(aaa,aaaa)
  622. Xint aaa;
  623. Xchar **aaaa;
  624. X{
  625. X    aaAaaa(aaa==aaaaaaa?aaaa[0]:aaaa[1],aaaa[0]);
  626. X    qqq = 39;
  627. X    ppPppp(&P,P->p);
  628. X}
  629. X
  630. X
  631. END_OF_FILE
  632.   if test 3153 -ne `wc -c <'1992/albert.orig.c'`; then
  633.     echo shar: \"'1992/albert.orig.c'\" unpacked with wrong size!
  634.   fi
  635.   # end of '1992/albert.orig.c'
  636. fi
  637. if test -f '1992/imc.hint' -a "${1}" != "-c" ; then 
  638.   echo shar: Will not clobber existing file \"'1992/imc.hint'\"
  639. else
  640.   echo shar: Extracting \"'1992/imc.hint'\" \(6479 characters\)
  641.   sed "s/^X//" >'1992/imc.hint' <<'END_OF_FILE'
  642. XBest Output: <imc@ecs.ox.ac.uk> Ian Collier
  643. X
  644. X    Ian Collier
  645. X    Oxford University
  646. X    The Queen's College
  647. X    High Street
  648. X    OXFORD
  649. X    OX1 4AW
  650. X    ENGLAND
  651. X
  652. X
  653. XJudges' comments:
  654. X
  655. X    Make and run.
  656. X
  657. X    The program is more interesting to run on workstations that can
  658. X    make use of a Sun raster file.  Others can make use of the -text
  659. X    flag for character oriented output.
  660. X
  661. X    Of course, the source (layout) is self-documenting!  :-)
  662. X
  663. X    NOTE: The original winning source imc.orig.c assumed that
  664. X      exit returned a value which cause problems for some
  665. X      systems where exit returned a void.  The file imc.c
  666. X      avoids this problem.
  667. X
  668. X
  669. XSelected notes from the author:
  670. X
  671. X    Portability
  672. X
  673. X    This program depends upon the ASCII character set, and makes certain
  674. X    assumptions about the architecture. It naughtily declares the first
  675. X    argument to main as a long, and passes a pointer to long instead of char
  676. X    to fwrite, giving a length value of 32 bytes for an array of 8 longs. I
  677. X    guess that makes this program OK on most flavours of unix, but not on
  678. X    PCs.
  679. X
  680. X    About the program
  681. X
  682. X    This program has several parameters; each of them has a default, so the
  683. X    program runs happily without any parameters. If you supply an incorrect
  684. X    parameter, an obfuscated error message results! :-) Should you want to
  685. X    run the program without knowing what it does, then supplying the single
  686. X    letter t as a parameter is a good move. Otherwise, direct the output
  687. X    into a file. The resulting file is most useful on Sun OS, where the
  688. X    "file" command will tell you what to do with it. For best results with
  689. X    the t option, you may want to change the definition of the I macro :-)
  690. X    Details appear later, though the formatting of the code is a large clue.
  691. X
  692. X    All the code in this program appears between the ";" and ")" in
  693. X    "for(;;)". That isn't because I want to win the best one-liner, but
  694. X    merely because it makes the code so much more impenetrable :-) In fact
  695. X    running a pretty printer on the code hardly improves it at all. This
  696. X    program has the obligatory macros with unmatched parentheses, and the
  697. X    cleverly arranged macro names and parameters to spell out "Ian Colliers
  698. X    Obfuscated C Code". If you expand macros, bear in mind that the more
  699. X    complex ones are best left as macros, because they have well-defined and
  700. X    nontrivial (IMHO) functions. These macros help to give the program's
  701. X    parameter format its flexibility. The parameters are sorted out in a
  702. X    unique way (based on an idea by Pete Bevin) which hides very effectively
  703. X    their identities (and I think that using a variable called _ adds a nice
  704. X    touch to the illegibility of the code). In this section of the code, the
  705. X    data types of the numbers checked against is varied, and just because
  706. X    you see a ',' doesn't mean it has anything to do with commas! So I hope
  707. X    you will agree that this program is more than a little obfuscated...
  708. X
  709. X    This is a Mandelbrot/Julia drawer. Normally it produces a monochrome
  710. X    Sun-format raster file. The version of xloadimage we have is able to
  711. X    view such files, and so is Sun's screenload command. [Note: the header
  712. X    contains eight 4-byte integers, the byte order in which depends upon the
  713. X    machine. On Sun workstations they are stored MSB first].
  714. X
  715. X    The program may be asked to produce text output instead of a raster
  716. X    file. Then the characters defined in the I macro will be used to create
  717. X    up to 16 different shades of grey. Quite a respectable picture can be
  718. X    gained by printing a 130x110 output on a dot matrix 132 column printer
  719. X    with the linefeed set to 7 points. Text output also gives a good picture
  720. X    when used in an X window with small characters having a square aspect
  721. X    ratio.
  722. X
  723. X    The options accepted by the program follow. Each option is a letter; it
  724. X    may be preceded with a minus sign (or any character in [!-/]) and may be
  725. X    followed by other letters, so for example
  726. X          m    -m     mask     *mail
  727. X    all mean the same thing. Most options may be followed by one or two
  728. X    numbers. These numbers may be separated from each other and from the
  729. X    option by a space, or may be joined to each other with a comma, or may
  730. X    be appended to the single-letter option, so
  731. X          -s100,200    size 100,200    -size123 100 200  s100 200
  732. X    all mean the same (note that in "-size123" all characters following the
  733. X    initial s are ignored). Numbers need not be specified, as each has a
  734. X    default value. In all cases except "j" and "t", and "s" whenever it
  735. X    appears before "t", specifying an option without numbers has no effect.
  736. X    (specifying "-s -t" has the effect of producing text with the default
  737. X    raster size; not a good idea!). The options are:
  738. X
  739. X    -centre x y  (float x,y) Centre the picture at x+iy in the complex
  740. X                             plane (default x=0 y=0)
  741. X    -factor f    (float f)   Use f pixels per unit of the plane (default
  742. X                             f=x/4 where x is the width)
  743. X    -julia  x y  (float x,y) Draw a julia set. Use x+iy as the constant
  744. X                             to add after squaring (default x=0 y=0)
  745. X    -limit  l    (int l)     Use l iterations maximum (default l=128)
  746. X    -mask   m    (int m)     Use m as a mask in deciding the colour of each
  747. X                             pixel (see below) (default m=1)
  748. X    -size   x y  (int x,y)   Produce an x-by-y output (default for raster
  749. X                             x=768 y=768; default for text x=63 y=23)
  750. X    -text                    Produce text instead of raster.
  751. X
  752. X    The colour of each point is determined by taking the bit-and of the
  753. X    number of iterations and the mask. For a raster, the point is black
  754. X    (1-bit) if the result is zero, white otherwise. For text, the result of
  755. X    the operation determines the grey-ness of the character produced, with a
  756. X    blank for zero going up to a star for the maximum value. For a
  757. X    four-colour picture, for example, use a mask with two bits set (e.g. 3),
  758. X    and for a 16-colour picture use a mask with four bits set (e.g. 15). For
  759. X    a picture with coarse detail, use a mask which ends with several zero
  760. X    bits (e.g. 8).
  761. X
  762. X    While the program is creating your picture, it displays dots on the
  763. X    standard error to indicate its progess (one dot per pixel line).
  764. X
  765. X    Here are a couple of good pictures to draw:
  766. X
  767. X    imc -s 512,512 -f 600000 -l 512 -m 16 -c.00805,.74274 > screen1.ras
  768. X    imc -s512,512 -j-.523,-.535 > screen2.ras
  769. END_OF_FILE
  770.   if test 6479 -ne `wc -c <'1992/imc.hint'`; then
  771.     echo shar: \"'1992/imc.hint'\" unpacked with wrong size!
  772.   fi
  773.   # end of '1992/imc.hint'
  774. fi
  775. if test -f '1992/nathan.hint' -a "${1}" != "-c" ; then 
  776.   echo shar: Will not clobber existing file \"'1992/nathan.hint'\"
  777. else
  778.   echo shar: Extracting \"'1992/nathan.hint'\" \(4546 characters\)
  779.   sed "s/^X//" >'1992/nathan.hint' <<'END_OF_FILE'
  780. XWorst Abuse of the Rules: <nathan@inmos.co.uk> Nathan Sidwell
  781. X
  782. X    Nathan Sidwell
  783. X    Inmos UK
  784. X    1000 Aztec West
  785. X    Almondsbury
  786. X    Bristol
  787. X    UK BS12 4SQ
  788. X
  789. X
  790. XJudges' comments:
  791. X
  792. X    The US International Traffic in Arms Regulations controls certain
  793. X    exportations going out of the United States.  The U.S.  Munitions
  794. X    List gives the specific categories of restricted exports.  Because
  795. X    this entry appears to fall under this restricted catagory, the
  796. X    judges may not be able to distribute winners outside of the USA.
  797. X
  798. X    Nathan Sidwell has stated that he is willing to distribute the
  799. X    winning source.  To read HIS instructions of how to obtain his
  800. X    winning program:
  801. X
  802. X    make nathan
  803. X    nathan
  804. X
  805. X    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  806. X    =-=-= The text below assumes that you have the winning source =-=-=
  807. X    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  808. X
  809. X    To use:
  810. X    make nathan
  811. X
  812. X    Try:
  813. X    nathan obfuscate < nathan.c > foobarf.c
  814. X    nathan - obfuscate < foobarf.c > barfoof.c
  815. X    diff nathan.c barfoof.c
  816. X
  817. X    WARNING:
  818. X    The judges' make no claim as to the strength or security
  819. X    of this program.  It is likely to be nil, or the next
  820. X    best thing to it.  Still, you might consider installing
  821. X    it in /usr/games/nathan.  :-)
  822. X
  823. X    NOTE: 
  824. X    The 'winning' catagory is also open to question.  One could say
  825. X    that it is a 'file obfuscator'.  One could also say that it
  826. X    unintentionally adbused the intent of rule #7 (that programs
  827. X    should be freely redistributable).  We suspect that the author
  828. X    may not have intended to do this, but that is the way things go
  829. X    sometimes.
  830. X
  831. X    BTW, 'abuse of the rules' entries do not violate the rules.
  832. X    Entries that violate the rules are disqualified.  Abuse of the
  833. X    rules entries are ones that tend to 'streach' the limits and
  834. X    take the contest into unexpected territory.
  835. X
  836. X
  837. XPersonal note from chongo:
  838. X
  839. X    I think this situation shows just how ridiculous US crypto
  840. X    regulations really are.  Certain US federal officials can get away
  841. X    with shipping arms to certain nations in apparent violation of US
  842. X    laws, but I personally can't re-distribute a program contest winner
  843. X    to the network!
  844. X
  845. X
  846. XSelected notes from the author:
  847. X
  848. X    PROGRAM USE
  849. X
  850. X    This program is a hello world text encrypter/decrypter. It uses an
  851. X    enigma (I think) style encryption algorithm, where the encryption
  852. X    key character is modified by a value, determined from the previous
  853. X    character.  Non-printable characters (those with ASCII values < ' '
  854. X    or > 0x7e) are passed unaltered, thus any kind of file may be
  855. X    successfully procesed, but if the original is printable, the
  856. X    processed file will be too. The input is read from stdin, and the
  857. X    output presented to stdout. The key, a text string, is presented as
  858. X    a command argument. This is optional, and if ommitted, the file is
  859. X    self-{de,en}crypted. To specify decryption, a "-" should be given
  860. X    before the key. (Actually encryption and dycryption proper inverse
  861. X    operations, so you can use decrypt to scramble and encrypt to
  862. X    descramble, if you're perverse.)
  863. X
  864. X    PORTABILITY (A little knowledge is a dangerous thing)
  865. X
  866. X    Its written in ANSI C, and doesn't even assume an ASCII character
  867. X    set, (it has an array of the characters to convert), so should be
  868. X    portable across many platforms. It passes gcc -ansi -pedantic -O
  869. X    -Wall with no warnings (You may get assignment in conditional
  870. X    warnings on other platforms though).  Because I've heard that
  871. X    conditional jumps slow down fast processors, I've eliminated all
  872. X    the ifs from the code, indeed, as its only one statement, it should
  873. X    compile to one instruction an a suitably designed CISC machine. To
  874. X    speed compilation, there is only one statement in the loop, so that
  875. X    another scoping level does not need to be opened.
  876. X
  877. X    Being an encrypter/decrypter, you probably want the source code to
  878. X    be obfuscated, to hide the algorithm.
  879. X
  880. X    OBFUSCATION
  881. X
  882. X    Inspite of the fact that it looks like a nice friendly hello world
  883. X    program, it isn't (as documented above). (Short lines have been padded,
  884. X    as you'll find if you look at an encrypted copy of the source.)
  885. X
  886. X    I've also named some of the macros from commonly used functions,
  887. X    just to keep things muddy. Of course, all the variables are
  888. X    misnamed. The program is kept simply (one for statement), by
  889. X    serious overuse of , and ? :. These are really confusing when used
  890. X    together, nested or put in argument lists (is that a comma
  891. X    operator, or argument separator?)
  892. END_OF_FILE
  893.   if test 4546 -ne `wc -c <'1992/nathan.hint'`; then
  894.     echo shar: \"'1992/nathan.hint'\" unpacked with wrong size!
  895.   fi
  896.   # end of '1992/nathan.hint'
  897. fi
  898. if test -f '1992/third' -a "${1}" != "-c" ; then 
  899.   echo shar: Will not clobber existing file \"'1992/third'\"
  900. else
  901.   echo shar: Extracting \"'1992/third'\" \(6605 characters\)
  902.   sed "s/^X//" >'1992/third' <<'END_OF_FILE'
  903. X: immediate _read @ ! - * / <0 exit echo key _pick
  904. X
  905. X: debug immediate 1 5 ! exit
  906. X
  907. X: r 1 exit
  908. X
  909. X: ] r @ 1 - r ! _read ]
  910. X
  911. X: _main immediate r @ 7 ! ]
  912. X_main
  913. X
  914. X
  915. X: _x 3 @ exit
  916. X: _y 4 @ exit
  917. X: _x! 3 ! exit
  918. X: _y! 4 ! exit
  919. X
  920. X
  921. X: swap _x! _y! _x _y exit
  922. X
  923. X: + 0 swap - - exit
  924. X
  925. X: dup _x! _x _x exit
  926. X
  927. X: inc dup @ 1 + swap ! exit
  928. X
  929. X: h 0 exit
  930. X
  931. X: , h @ ! h inc exit
  932. X
  933. X
  934. X: ' r @ @ dup 1 + r @ ! @ exit
  935. X
  936. X: ; immediate ' exit , exit
  937. X
  938. X
  939. X: drop 0 * + ;
  940. X
  941. X: dec dup @ 1 - swap ! ;
  942. X
  943. X: tor r @ @ swap r @ ! r @ 1 + r ! r @ ! ;
  944. X
  945. X: fromr r @ @ r @ 1 - r ! r @ @ swap r @ ! ;
  946. X
  947. X: tail fromr fromr drop tor ;
  948. X
  949. X: minus 0 swap - ;
  950. X
  951. X: bnot 1 swap - ;
  952. X
  953. X: < - <0 ;
  954. X
  955. X: logical dup 0 < swap minus 0 < + ;
  956. X
  957. X: not logical bnot ;
  958. X
  959. X: = - not ;
  960. X
  961. X: branch r @ @ @ r @ @ + r @ ! ;
  962. X
  963. X: computebranch 1 - * 1 + ;
  964. X
  965. X: notbranch
  966. X  not
  967. X  r @ @ @
  968. X  computebranch
  969. X  r @ @ +
  970. X  r @ !
  971. X;
  972. X
  973. X: here h @ ;
  974. X
  975. X: if immediate ' notbranch , here 0 , ;
  976. X
  977. X: then immediate dup here swap - swap ! ;
  978. X
  979. X: ')' 0 ;
  980. X
  981. X: _fix key drop key swap 2 + ! ;
  982. X
  983. X: fix-')' immediate ' ')' _fix ;
  984. X
  985. Xfix-')' )
  986. X
  987. X: find-) key ')' = not if tail find-) then ;
  988. X
  989. X: ( immediate find-) ;
  990. X
  991. X( we should be able to do FORTH-style comments now )
  992. X
  993. X( this works as follows: ( is an immediate word, so it gets
  994. X  control during compilation.  Then it simply reads in characters
  995. X  until it sees a close parenthesis.  once it does, it exits.
  996. X  if not, it pops off the return stack--manual tail recursion. )
  997. X
  998. X( now that we've got comments, we can comment the rest of the code! )
  999. X
  1000. X: else immediate
  1001. X  ' branch ,        ( compile a definite branch )
  1002. X  here            ( push the backpatching address )
  1003. X  0 ,            ( compile a dummy offset for branch )
  1004. X  swap            ( bring old backpatch address to top )
  1005. X  dup here swap -    ( calculate the offset from old address )
  1006. X  swap !        ( put the address on top and store it )
  1007. X;
  1008. X
  1009. X: over _x! _y! _y _x _y ;
  1010. X
  1011. X: add
  1012. X  _x!            ( save the pointer in a temp variable )
  1013. X  _x @            ( get the value pointed to )
  1014. X  +            ( add the incremement from on top of the stack )
  1015. X  _x !            ( and save it )
  1016. X;
  1017. X
  1018. X: allot    h add ;
  1019. X
  1020. X: maybebranch
  1021. X  logical        ( force the TOS to be 0 or 1 )
  1022. X  r @ @ @        ( load the branch offset )
  1023. X  computebranch    ( calculate the condition offset [either TOS or 1])
  1024. X  r @ @ +        ( add it to the return address )
  1025. X  r @ !        ( store it to our return address and return )
  1026. X;
  1027. X
  1028. X: mod _x! _y!        ( get x then y off of stack )
  1029. X  _y
  1030. X  _y _x / _x *        ( y - y / x * x )
  1031. X  -
  1032. X;
  1033. X
  1034. X: '\n' 0 ;
  1035. X: '"' 0 ;
  1036. X: '0' 0 ;
  1037. X: 'space' 0 ;
  1038. X
  1039. X: fix-'\n' immediate ' '\n' _fix ;
  1040. X: fix-'"' immediate ' '"' _fix ;
  1041. X: fix-'0' immediate ' '0' _fix ;
  1042. X: fix-'space' immediate ' 'space' _fix ;
  1043. X
  1044. Xfix-'0' 0 fix-'space'  fix-'"' "
  1045. Xfix-'\n'
  1046. X
  1047. X
  1048. X: cr '\n' echo exit
  1049. X
  1050. X: printnum
  1051. X  dup
  1052. X  10 mod '0' +
  1053. X  swap 10 / dup
  1054. X  if
  1055. X    printnum 0
  1056. X  then
  1057. X  drop echo
  1058. X;
  1059. X
  1060. X: .
  1061. X  dup 0 <
  1062. X  if
  1063. X    45 echo minus
  1064. X  then
  1065. X  printnum
  1066. X  'space' echo
  1067. X;
  1068. X
  1069. X
  1070. X: debugprint dup . cr ;
  1071. X
  1072. X( the following routine takes a pointer to a string, and prints it,
  1073. X  except for the trailing quote.  returns a pointer to the next word
  1074. X  after the trailing quote )
  1075. X
  1076. X: _print
  1077. X  dup 1 +
  1078. X  swap @
  1079. X  dup '"' =
  1080. X  if
  1081. X    drop exit
  1082. X  then
  1083. X  echo
  1084. X  tail _print
  1085. X;
  1086. X
  1087. X: print _print ;
  1088. X
  1089. X  ( print the next thing from the instruction stream )
  1090. X: immprint
  1091. X  r @ @
  1092. X  print
  1093. X  r @ !
  1094. X;
  1095. X
  1096. X: find-"
  1097. X  key dup ,
  1098. X  '"' =
  1099. X  if
  1100. X    exit
  1101. X  then
  1102. X  tail find-"
  1103. X;
  1104. X
  1105. X: " immediate
  1106. X  key drop
  1107. X  ' immprint ,
  1108. X  find-"
  1109. X;
  1110. X
  1111. X: do immediate
  1112. X  ' swap ,        ( compile 'swap' to swap the limit and start )
  1113. X  ' tor ,        ( compile to push the limit onto the return stack )
  1114. X  ' tor ,        ( compile to push the start on the return stack )
  1115. X  here            ( save this address so we can branch back to it )
  1116. X;
  1117. X
  1118. X: i r @ 1 - @ ;
  1119. X: j r @ 3 - @ ;
  1120. X
  1121. X: > swap < ;
  1122. X: <= 1 + < ;
  1123. X: >= swap <= ;
  1124. X
  1125. X: inci 
  1126. X  r @ 1 -     ( get the pointer to i )
  1127. X  inc        ( add one to it )
  1128. X  r @ 1 - @     ( find the value again )
  1129. X  r @ 2 - @    ( find the limit value )
  1130. X  <
  1131. X  if
  1132. X    r @ @ @ r @ @ + r @ ! exit        ( branch )
  1133. X  then
  1134. X  fromr 1 +
  1135. X  fromr drop
  1136. X  fromr drop
  1137. X  tor
  1138. X;
  1139. X      
  1140. X: loop immediate ' inci , here - , ;
  1141. X
  1142. X: loopexit
  1143. X
  1144. X  fromr drop        ( pop off our return address )
  1145. X  fromr drop        ( pop off i )
  1146. X  fromr drop        ( pop off the limit of i )
  1147. X;            ( and return to the caller's caller routine )
  1148. X
  1149. X: isprime
  1150. X  dup 2 = if
  1151. X    exit
  1152. X  then
  1153. X  dup 2 / 2        ( loop from 2 to n/2 )
  1154. X  do
  1155. X    dup            ( value we're checking if it's prime )
  1156. X    i mod        ( mod it by divisor )
  1157. X    not if
  1158. X      drop 0 loopexit    ( exit from routine from inside loop )
  1159. X    then
  1160. X  loop 
  1161. X;
  1162. X
  1163. X: primes
  1164. X  " The primes from "
  1165. X  dup .
  1166. X  "  to "
  1167. X  over .
  1168. X  "  are:"
  1169. X  cr
  1170. X
  1171. X  do
  1172. X    i isprime 
  1173. X    if
  1174. X      i . 'space' echo
  1175. X    then
  1176. X  loop
  1177. X  cr
  1178. X;
  1179. X
  1180. X: execute
  1181. X  8 !
  1182. X  ' exit 9 !
  1183. X  8 tor
  1184. X;
  1185. X
  1186. X: :: ;        ( :: is going to be a word that does ':' at runtime )
  1187. X
  1188. X: fix-:: immediate 3 ' :: ! ;
  1189. Xfix-::
  1190. X
  1191. X    ( Override old definition of ':' with a new one that invokes ] )
  1192. X: : immediate :: ] ;
  1193. X
  1194. X: command
  1195. X  here 5 !        ( store dict pointer in temp variable )
  1196. X  _read            ( compile a word )
  1197. X            ( if we get control back: )
  1198. X  here 5 @
  1199. X  = if
  1200. X    tail command    ( we didn't compile anything )
  1201. X  then
  1202. X  here 1 - h !        ( decrement the dictionary pointer )
  1203. X  here 5 @        ( get the original value )
  1204. X  = if
  1205. X    here @        ( get the word that was compiled )
  1206. X    execute        ( and run it )
  1207. X  else
  1208. X    here @        ( else it was an integer constant, so push it )
  1209. X    here 1 - h !    ( and decrement the dictionary pointer again )
  1210. X  then
  1211. X  tail command
  1212. X;
  1213. X
  1214. X: make-immediate    ( make a word just compiled immediate )
  1215. X  here 1 -        ( back up a word in the dictionary )
  1216. X  dup dup        ( save the pointer to here )
  1217. X  h !            ( store as the current dictionary pointer )
  1218. X  @            ( get the run-time code pointer )
  1219. X  swap            ( get the dict pointer again )
  1220. X  1 -            ( point to the compile-time code pointer )
  1221. X  !            ( write run-time code pointer on compile-time pointer )
  1222. X;
  1223. X
  1224. X: <build immediate
  1225. X  make-immediate    ( make the word compiled so far immediate )
  1226. X  ' :: ,        ( compile '::', so we read next word )
  1227. X  2 ,            ( compile 'pushint' )
  1228. X  here 0 ,        ( write out a 0 but save address for does> )
  1229. X  ' , ,            ( compile a push that address onto dictionary )
  1230. X;
  1231. X
  1232. X: does> immediate
  1233. X  ' command ,        ( jump back into command mode at runtime )
  1234. X  here swap !        ( backpatch the build> to point to here )
  1235. X  2 ,            ( compile run-code primitive so we look like a word )
  1236. X  ' fromr ,        ( compile fromr, which leaves var address on stack )
  1237. X;
  1238. X
  1239. X
  1240. X: _dump            ( dump out the definition of a word, sort of )
  1241. X  dup " (" . " , "
  1242. X  dup @            ( save the pointer and get the contents )
  1243. X  dup ' exit
  1244. X  = if
  1245. X    " ;)" cr exit
  1246. X  then
  1247. X  . " ), "
  1248. X  1 +
  1249. X  tail _dump
  1250. X;
  1251. X
  1252. X: dump _dump ;
  1253. X
  1254. X: # . cr ;
  1255. X  
  1256. X: var <build , does> ;
  1257. X: constant <build , does> @ ;
  1258. X: array <build allot does> + ;
  1259. X
  1260. X: [ immediate command ;
  1261. X: _welcome " Welcome to THIRD.
  1262. XOk.
  1263. X" ;
  1264. X
  1265. X: ; immediate ' exit , command exit
  1266. X
  1267. X[
  1268. X
  1269. X_welcome
  1270. END_OF_FILE
  1271.   if test 6605 -ne `wc -c <'1992/third'`; then
  1272.     echo shar: \"'1992/third'\" unpacked with wrong size!
  1273.   fi
  1274.   # end of '1992/third'
  1275. fi
  1276. if test -f '1992/vern.hint' -a "${1}" != "-c" ; then 
  1277.   echo shar: Will not clobber existing file \"'1992/vern.hint'\"
  1278. else
  1279.   echo shar: Extracting \"'1992/vern.hint'\" \(6513 characters\)
  1280.   sed "s/^X//" >'1992/vern.hint' <<'END_OF_FILE'
  1281. XBest of Show: <vern@ee.lbl.gov> Vern Paxson
  1282. X
  1283. X    Vern Paxson
  1284. X    Lawrence Berkeley Laboratory
  1285. X    Computer Systems Engineering
  1286. X    Bldg. 46A, Room 1123
  1287. X    Lawrence Berkeley Laboratory
  1288. X    1 Cyclotron Rd.
  1289. X    Berkeley, CA 94720  USA
  1290. X
  1291. X
  1292. XJudges' comments:
  1293. X
  1294. X     Try: 
  1295. X    make vern
  1296. X    vern 3        <-- default is 2
  1297. X
  1298. X     You might start off by giving the following input:
  1299. X    63 43
  1300. X    76 55
  1301. X    71 52
  1302. X    67 57        (this may take a while)
  1303. X    
  1304. X    The judges assume no responsibility for the obfuscated opening
  1305. X    suggested above.  :-)
  1306. X
  1307. X    For a real quick game try:
  1308. X    vern
  1309. X
  1310. X    65 55
  1311. X    66 46
  1312. X
  1313. X    NOTE: Move values must be restricted to the range 00 to 77.
  1314. X
  1315. X    NOTE: Because some mailers have problems with the original winning source,
  1316. X      a slightly modified version with shorter lines has been provided.
  1317. X
  1318. X
  1319. XSelected notes from the author:
  1320. X
  1321. X    This program plays chess.  You play the white pieces and the program
  1322. X    the black pieces.  Moves are entered as a two-digit number specifying
  1323. X    the coordinates of the piece to be moved followed by another two-digit
  1324. X    number specifying the coordinates of where to move it.  Rows and
  1325. X    columns are numbered starting with (0,0) for the upper-lefthand corner
  1326. X    (black's queen's rook) and going to (7,7) for the lower-righthand
  1327. X    corner (white's king's rook).  For example, the PK4 opening for white
  1328. X    is indicated as "64 44".  Moves are read using scanf() so care should
  1329. X    be taken to not enter the wrong number of fields.
  1330. X
  1331. X    If the move you enter is illegal then you are just prompted again to
  1332. X    move.  If the move is legal then the new position is displayed and the
  1333. X    program starts computing its response.  For every 64 board positions it
  1334. X    examines a "." is printed.  Once it has chosen its move it simply
  1335. X    displays the board updated to reflect the move.
  1336. X
  1337. X    Your move is prompted for using a string like "1351 9 2 >".  The first
  1338. X    number is how many board positions the program examined when computing
  1339. X    its previous response.  The second number is its anticipated value for
  1340. X    the move it just made (with larger numbers meaning an ultimately better
  1341. X    board position for it), and the third number is the evaluation it
  1342. X    assigns to the your current position (larger numbers meaning better
  1343. X    positions for you).  A ">" indicates that you are not in check; for
  1344. X    check it is changed to "!".
  1345. X
  1346. X    There are a few limitations on play:
  1347. X
  1348. X    o        castling can only be done on the king's side;
  1349. X    o        prohibitions against castling out of or through check are
  1350. X             not enforced;
  1351. X    o        prohibitions against castling if the king or rook have moved
  1352. X             are not enforced;
  1353. X    o        pawns are always promoted to queens;
  1354. X    o        en passant is not allowed;
  1355. X    o        the board-position-repeated-three-times and fifty-moves
  1356. X             stalemates are not recognized;
  1357. X
  1358. X    If you checkmate the computer it prints "Rats!" and exits.  If your own
  1359. X    checkmate is imminent it prints "Har har." but doesn't exit so it can
  1360. X    rub your nose in defeat (which may be a move or two away if you're
  1361. X    playing at a high "ply" - see the next paragraph).  Stalemates are not
  1362. X    recognized per se, but when selecting its move the program assigns a
  1363. X    stalemate position a value of 0 so it will try for a stalemate if its
  1364. X    other options are worse.
  1365. X
  1366. X    The program takes one optional argument indicating the ply (lookahead)
  1367. X    it should use.  The default is 2, which is enough to keep it from
  1368. X    making flaming blunders.  The higher the ply, the better the play, and
  1369. X    the longer you have to wait.  For example, at a ply of 2, a response to
  1370. X    the PK4 opening takes about 1.8 CPU seconds on a SPARC ELC when
  1371. X    compiled -O with Sun cc.  A ply of 3 takes 13 CPU seconds (and results
  1372. X    in a different response to PK4) and a ply of 4 takes a little under 4
  1373. X    CPU minutes (and for PK4 comes up with the same response as a ply of
  1374. X    3).  A ply of 3 is in general good enough to avoid not only flaming
  1375. X    blunders but also immediately stupid moves altogether.  A ply of 4
  1376. X    will find all mate-in-two's.
  1377. X
  1378. X
  1379. X
  1380. X    This program is obfuscated in a number of ways.  First, it abuses the
  1381. X    contest rule regarding ';', '{', and '}' in the source not counting
  1382. X    against the non-whitespace character limit if followed by whitespace.
  1383. X    As can be seen from the build file, certain combinations of these
  1384. X    characters followed by a particular whitespace character are expanded
  1385. X    at build time into much-needed text.  Without this hack the program
  1386. X    wouldn't pass the character limit.  A nice side effect is that the
  1387. X    initial source is gloriously difficult to peruse.
  1388. X
  1389. X    Second, the rather ho-hum step has been taking of naming each variable
  1390. X    with a one or two letter identifier to render it meaningless (and save
  1391. X    space).  This tactic is rather effective in a complex program.
  1392. X
  1393. X    Third, the board is represented not as an array of pieces but rather as
  1394. X    an array of function pointers (with a separate array representing
  1395. X    whether a piece is white or black).  This obfuscates the program's
  1396. X    central data structure.  There is one function per type of piece; when
  1397. X    called they return 1 if the current move is illegal for that piece and
  1398. X    0 if it is legal.  The functions also as a side effect set a global
  1399. X    indicating the type of the piece (though the type can also be determined
  1400. X    by comparing the function pointer with the function itself).
  1401. X
  1402. X    Fourth, there are no independent routines for generating potential
  1403. X    moves.  Instead, the program generates its moves by brute force: for
  1404. X    every piece it controls on the board, it attempts to move it to every
  1405. X    square on the board.  Those moves that are legal it then explores to
  1406. X    see their effects (using alpha-beta search).  This tactic somewhat
  1407. X    obfuscates the algorithm used by the program.
  1408. X
  1409. X    Finally, there are three key constants that occur throughout the
  1410. X    program:  64, 8, and 3 (lg 8).  Rather than making these available at
  1411. X    compile-time, which provides a hint as to what the program is up to,
  1412. X    they are computed probabilistically at run-time.  An instance of the
  1413. X    "Inspection Paradox" is used which happens to produce a value that on
  1414. X    average is close to .64.  10000 instances of this value are computed,
  1415. X    added up, and then divided by 100.  Sometimes the value produced will
  1416. X    be 63 or 65 instead of 64 (but I've never observed any other values),
  1417. X    so the result is then rounded to the nearest multiple of 4, and then
  1418. X    the other constants are derived from it.
  1419. END_OF_FILE
  1420.   if test 6513 -ne `wc -c <'1992/vern.hint'`; then
  1421.     echo shar: \"'1992/vern.hint'\" unpacked with wrong size!
  1422.   fi
  1423.   # end of '1992/vern.hint'
  1424. fi
  1425. if test -f '1992/vern.orig.c' -a "${1}" != "-c" ; then 
  1426.   echo shar: Will not clobber existing file \"'1992/vern.orig.c'\"
  1427. else
  1428.   echo shar: Extracting \"'1992/vern.orig.c'\" \(3201 characters\)
  1429.   sed "s/^X//" >'1992/vern.orig.c' <<'END_OF_FILE'
  1430. X#include <stdio.h>
  1431. X;    m(x)(x<0?-1:!!x)
  1432. X;    g tj()-J
  1433. X;    a(x)(x<0?-x:x)
  1434. X;    h(x)((x)<=K?x:N-(x))
  1435. X;    f 9999
  1436. X;    A return
  1437. X;    H printf{ 
  1438. X;    R double
  1439. X;    U int
  1440. X;    V for
  1441. X;    b else
  1442. X;    u while
  1443. X;    B if
  1444. XU v,w,Y}     -1,W,J,p,F,o}    f,M,N,K,X,YY,_,P[f],s{ } ;
  1445. Xtypedef U{ *L} { } ;
  1446. XL q[f];
  1447. Xtj{ } {
  1448. XU S}    m{ v} +{ m{ w} <<K} ; 
  1449. XB{ !S} A J; 
  1450. XV{ v}    W+S; v!}    J&&!q[v]; v+}    S} ;
  1451. XA v; 
  1452. X}
  1453. Xk{ } {
  1454. X_}    K; 
  1455. XA v?a{ v} >1||w-Y||!q[J]:{ w-Y&&{ w-Y*2||q[W+Y*{ N+1} ]||
  1456. X    { J>>K} -K+{ Y-1} / 2} } ||q[J]; 
  1457. X}
  1458. Xz{ } {
  1459. X_}    5; 
  1460. XA v*w||g; 
  1461. X}
  1462. Xe{ } {
  1463. X_}     -2; 
  1464. XA{ v*v*v-v||w*w*w-w} &&{ J-W-2||{ W&N} -4||{ W>>K!}    { Y-1?N:0} } ||
  1465. X    q[W+1]||q[W+2]||q[W+K]!}    z||P[W+K]*Y<0} ; 
  1466. X}
  1467. XR VR{ } {
  1468. Xint PZ}    0x7fff; 
  1469. XA{ R} { rand{ } &PZ} /{ R} PZ; 
  1470. X}
  1471. Xl{ } {
  1472. X_}    K+1; 
  1473. XA{ v*w&&a{ v} -a{ w} } ||g; 
  1474. X}
  1475. XR UC{ } {
  1476. XR {    }    0,d; 
  1477. Xu{ { {    +}    d}    VR{ } } <1.0} ; 
  1478. XA d; 
  1479. X}
  1480. Xc{ } {
  1481. X_}     -11; 
  1482. XA a{ v} -a{ w} ||g; 
  1483. X}
  1484. XI{ ur,n,x} {
  1485. XW}    ur; 
  1486. XJ}    n; 
  1487. XB{ P[W]!}    Y||P[J]}    }    Y} A J+1;
  1488. Xv}    { J&N} -{ W&N} ; 
  1489. Xw}    { J>>K} -{ W>>K} ; 
  1490. XA q[W]{ } ||{ x&&QL{ W,J,s} } ; 
  1491. X}
  1492. XTT{ W} {
  1493. Xv}    w}    0; 
  1494. XA q[W]{ } +K; 
  1495. X}
  1496. Xs{ } {
  1497. XU j}     -1,{    ; 
  1498. XY}     -Y; 
  1499. XV{ {    }    0; {    <M; ++{    } {
  1500. XB{ j<0&&P[{    ]}    }     -Y&&TT{ {    } &&_}    }     -2} 
  1501. X{
  1502. Xj}    {    ; 
  1503. X{    }     -1; 
  1504. X}
  1505. Xb B{ j>}    0&&!I{ {    ,j,0} } A Y}     -Y; 
  1506. X}
  1507. XA!{ Y}     -Y} ; 
  1508. X}
  1509. Xbb{ } {
  1510. X_}    1; 
  1511. XA a{ v*w} -2; 
  1512. X}
  1513. Xuv{ } {
  1514. XV{ v}    0; v<f; ++v} {
  1515. XB{ h{ v>>K} }    }    0} {
  1516. XU S}    h{ v&N} ;
  1517. Xq[v]}    !S?z:{ S}    }    1?bb:{ S}    }    2?c:{ v&N>K?l:e} } } ; 
  1518. X}
  1519. Xb B{ h{ v>>K} }    }    1} q[v]}    k; 
  1520. Xb q[v]}    0;
  1521. XP[v]}    !!q[v]*{ 28-v} ; 
  1522. X}
  1523. X}
  1524. Xy{ } {
  1525. XU G}    Y,{    ; 
  1526. XJ}    0; 
  1527. XV{ {    }    0; {    <M; ++{    } {
  1528. X{    %8||H"\n%4o ",{    } ;
  1529. XB{ { Y}    P[{    ]}    m{ P[{    ]} } &&TT{ {    } } H"%c ",_+93+Y*16} ; 
  1530. Xb H"- "} ; 
  1531. X}
  1532. XH"\n    "} ; 
  1533. Xdo 
  1534. XH"%2d",{    ++&N} ; 
  1535. Xu{ {    &N} ; 
  1536. XY}    G; 
  1537. XH"\n"} ; 
  1538. X}
  1539. XO{ W,J} {
  1540. XB{ { q[J]}    q[W]} }    }    k&&h{ J>>K} }    }    0} q[J]}    l; 
  1541. XB{ q[W]}    }    e} B{ J-W}    }    2} O{ J+1,J-1} ;
  1542. Xb B{ W-J}    }    2} O{ W-1,W+1} ; 
  1543. XP[J]}    P[W]; 
  1544. Xq[W]}    0;
  1545. XP[W]}    0; 
  1546. X}
  1547. XQL{ W,J,D} L D; 
  1548. X{
  1549. XU HQ}    P[J],YX; 
  1550. XL AJ}    q[J],XY}    q[W]; 
  1551. XO{ W,J} ; 
  1552. XYX}    D{ } ;
  1553. XO{ J,W} ; 
  1554. Xq[J]}    AJ; 
  1555. Xq[W]}    XY; 
  1556. XP[J]}    HQ; 
  1557. XA YX; 
  1558. X}
  1559. XC{ } {
  1560. XU {    ,j,BZ}    0; 
  1561. XV{ {    }    0; {    <M; ++{    } {
  1562. XL Z}    q[{    ]; 
  1563. XB{ Z} {
  1564. XU r}    h{ {    >>K} +h{ {    &N} ,G}    Y,
  1565. X    S}    Z}    }    z?88:{ Z}    }    k?11+r+{ P[{    ]<0?N-{ {    >>K} :{ {    >>K} } :
  1566. X{ Z}    }    l?124-{ { YY<8&&{ { {    &N} !}    K||
  1567. X    { {    >>K} !}    { P[{    ]>0?0:N} } } ?M:0} :
  1568. X{ Z}    }    c?41+r:{ Z}    }    e?f-r-r:36+r+r} } } } ; 
  1569. XY}    P[{    ];
  1570. XV{ j}    0; j<M; ++j} B{ !I{ {    ,j,0} } S+}    { P[j]?5:1} ; 
  1571. XBZ+}    G}    }    Y?S:-S;
  1572. XY}    G; 
  1573. X}
  1574. X}
  1575. XB{ !{ ++X&M-1} } write{ 1,".",1} ; 
  1576. XA BZ; 
  1577. X}
  1578. XPX{ } {
  1579. XU {    ,Q}    0,XP}    0,JZ}    M*M,E}     -f,t,S}    o; 
  1580. XB{ !F--} A++F+C{ } ;
  1581. XV{ {    }    0; {    <JZ; ++{    } B{ !I{ {    >>K+K,{    &M-1,1} } {
  1582. XY}     -Y; 
  1583. Xo}     -E;
  1584. Xt}     -QL{ {    >>K+K,{    &M-1,PX} ; 
  1585. XY}     -Y; 
  1586. XB{ t>E} {
  1587. X++XP; 
  1588. XQ}    {    ; 
  1589. XE}    t; 
  1590. XB{ E>}    S} 
  1591. XA++F,E; 
  1592. X}
  1593. X}
  1594. XB{ !XP} E}    s{ } ?-f+1:0; 
  1595. Xp}    Q; 
  1596. XA++F,E; 
  1597. X}
  1598. XRZ{ } {
  1599. XU {    ,j,T}    0; 
  1600. XV{ ; ; } {
  1601. Xy{ } ; 
  1602. Xo}    f; 
  1603. Xdo{
  1604. XH"\n%d %d %d %s ",X,T,C{ } ,s{ } ?"!":">"} ;
  1605. Xfflush{ stdout} ; 
  1606. X}
  1607. Xu{ scanf{ "%o%o",&{    ,&j} !}    2||I{ {    ,j,1} } ;
  1608. XO{ {    ,j} ; 
  1609. Xy{ } ; 
  1610. XX}    0; 
  1611. X++YY;
  1612. XY}     -Y; 
  1613. XT}    PX{ } ; 
  1614. X{    }    p>>{ K<<1} ; 
  1615. Xj}    p&{ M-1} ; 
  1616. XB{ I{ {    ,j,1} } {
  1617. XH"Rats!\n"} ; 
  1618. XA; 
  1619. X}
  1620. XO{ {    ,j} ; 
  1621. XY}     -Y; 
  1622. XB{ T>M*M} H"\nHar har.\n"} ; 
  1623. X}
  1624. X}
  1625. Xmain{ ac,av} char**av; 
  1626. X{
  1627. Xlong time{ } ,j}    time{ &j} ; 
  1628. XR {    }    0; 
  1629. Xsrand{ { U} j} ;
  1630. XV{ M}    0; M<}    f; ++M} {    +}    UC{ } ; 
  1631. XM}    {    /100;
  1632. XB{ M&3} ++M; 
  1633. XB{ M&1} --M; 
  1634. XV{ N}    1; N*N<M; ++N} ;
  1635. XK}     --N/2; 
  1636. XF}    ac>1?atoi{ av[1]} :2; 
  1637. Xuv{ } ;
  1638. XRZ{ } ; 
  1639. X}
  1640. END_OF_FILE
  1641.   if test 3201 -ne `wc -c <'1992/vern.orig.c'`; then
  1642.     echo shar: \"'1992/vern.orig.c'\" unpacked with wrong size!
  1643.   fi
  1644.   # end of '1992/vern.orig.c'
  1645. fi
  1646. if test -f '1992/westley.hint' -a "${1}" != "-c" ; then 
  1647.   echo shar: Will not clobber existing file \"'1992/westley.hint'\"
  1648. else
  1649.   echo shar: Extracting \"'1992/westley.hint'\" \(4374 characters\)
  1650.   sed "s/^X//" >'1992/westley.hint' <<'END_OF_FILE'
  1651. XBest Small Program: <merlyn@digibd.com> Brian Westley (aka Merlyn LeRoy)
  1652. X
  1653. X    Brian Westley (aka Merlyn LeRoy)
  1654. X    Digi International
  1655. X    1026 Blair Ave.
  1656. X    St. Paul, MN  55104
  1657. X    USA
  1658. X
  1659. X
  1660. XJudges' comments:
  1661. X
  1662. X    If lost:
  1663. X    make whereami
  1664. X    
  1665. X    Then run:
  1666. X    whereami lat long
  1667. X    
  1668. X    Where lat and long correspond to your latitude and longitude.
  1669. X
  1670. X    To find the approximate place where this entry was judged, type:
  1671. X
  1672. X    whereami 37 -122    (- means west of meridian)
  1673. X    
  1674. X
  1675. XSelected notes from the author:
  1676. X
  1677. X    Run the program with your latitude & longitude as integer
  1678. X    arguments; it will produce a map made up of '!' with the given
  1679. X    position marked with either a '"' (if the position is over a '!')
  1680. X    or a '#' (if the position is over a space).  Southern latitudes
  1681. X    and western longitudes are entered as negative numbers.  For
  1682. X    example, to find San Francisco, run with "prog 38 -122".  The
  1683. X    resolution of the map is five degrees horizontally, ten degrees
  1684. X    vertically.  The map is a Mercator projection with equal spacing
  1685. X    of the latitudes, so the areas near the poles are very distorted.
  1686. X    Latitudes near the poles and Antarctica are not shown.
  1687. X
  1688. X    The program requires the ASCII character set, putchar(), atoi(),
  1689. X    and a display that auto-wraps at 80 characters(!).  If your display
  1690. X    does not work this way, you will have to massage the output;
  1691. X    for example, you can pipe it to a file and edit it with vi,
  1692. X    which will do autowrap for you.
  1693. X
  1694. X    Lint complains that main() returns a random value and I'm not
  1695. X    checking the value that putchar() returns.  Scandalous!
  1696. X
  1697. X    If you run it with fewer than 2 arguments, it will likely
  1698. X    give you an exception, as it will access arguments that
  1699. X    don't exist and characters before a string constant.
  1700. X
  1701. X    How it works:
  1702. X
  1703. X    The map is printed as one long string of ' ' and '!' characters,
  1704. X    with the autowrap used to stack up slices of 80.  The map data is
  1705. X    a string; the first character is how many '!'s are printed
  1706. X    ('A'=1, 'B'=2, etc), the second character is how many ' 's, the
  1707. X    third is how many '!'s, etc.  ASCII characters less than 'A'
  1708. X    print no characters but still change the polarity, so any map
  1709. X    of ' 's and '!'s is possible.  This is done in the putchar()
  1710. X    argument as "33^l&1", where l is the character position+4; if
  1711. X    l is odd, ' ' is printed, if l is even, '!' is printed.
  1712. X
  1713. X    The position of latitude & longitude is changed into a single
  1714. X    character position within the one long string via the first
  1715. X    expression "d = latitude/10*80 - longitude/5 - offset"  The
  1716. X    latitude is divided by ten because the vertical resolution is
  1717. X    ten degrees, then multiplied by 80 because of the 80 character
  1718. X    wrap (i.e. each ten degrees moves the position up or down one
  1719. X    entire row).  The longitude is divided by five and added, because
  1720. X    five degrees of change moves the location one character.  The signs
  1721. X    are opposite because latitude is decreasing and longitude is
  1722. X    increasing as you go from upper left to lower right.  The offset
  1723. X    is where the origin (latitude=0, longitude=0) is found.
  1724. X
  1725. X    The position counting down to zero changes the putchar() from
  1726. X    printing ('!' or ' ') to printing ('"' or '#').
  1727. X
  1728. X    The "H E L L O,   W O R L D!" string inside the data string
  1729. X    prints the line of blanks past Tierra del Fuego and the last
  1730. X    blank line.  It's just for show, really.
  1731. X
  1732. X    Since the resolution is coarse, a few costal cities are shown to
  1733. X    be just off the map; this is an unavoidable artifact.  The map
  1734. X    is reasonably accurate.
  1735. X
  1736. X    Here are some cities you might like to try:
  1737. X
  1738. X         New York  41  -74       Los Angeles  34 -118
  1739. X           London  52    0             Paris  45    2
  1740. X           Moscow  56   38           Beijing  40  116
  1741. X        New Delhi  29   77    Rio de Janeiro -23  -43
  1742. X           Sydney -34  151             Tokyo  36  140
  1743. X
  1744. XFor a domestic (USA) version with higher resolution, try:
  1745. X---cut---
  1746. Xmain(l,a,n,d)char**a;{for(d=atoi(a[1])/2*80-atoi(a[2])-2043;
  1747. Xn="bnaBCOCXdBBHGYdAP[A M E R I C A].AqandkmavX|ELC}BOCd"
  1748. X[l++-3];)for(;n-->64;)putchar(!d+++33^l&1);}
  1749. X---cut---
  1750. XThe code will test the 80-column wrap and document itself if it is
  1751. Xjoined together as one 160-character line and listed.  You should see:
  1752. X
  1753. Xmain(l,a,n,d)...
  1754. X[A M E R I C A]...
  1755. X
  1756. X...going down the left edge if your terminal autowraps at 80 characters.
  1757. END_OF_FILE
  1758.   if test 4374 -ne `wc -c <'1992/westley.hint'`; then
  1759.     echo shar: \"'1992/westley.hint'\" unpacked with wrong size!
  1760.   fi
  1761.   # end of '1992/westley.hint'
  1762. fi
  1763. echo shar: End of archive 3 \(of 5\).
  1764. cp /dev/null ark3isdone
  1765. MISSING=""
  1766. for I in 1 2 3 4 5 ; do
  1767.     if test ! -f ark${I}isdone ; then
  1768.     MISSING="${MISSING} ${I}"
  1769.     fi
  1770. done
  1771. if test "${MISSING}" = "" ; then
  1772.     echo You have unpacked all 5 archives.
  1773.     rm -f ark[1-9]isdone
  1774. else
  1775.     echo You still must unpack the following archives:
  1776.     echo "        " ${MISSING}
  1777. fi
  1778. exit 0
  1779. exit 0 # Just in case...
  1780.