Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!ihnp4!houxm!mhuxl!eagle!harpo!seismo!hao!hplabs!sri-unix!knutsen From: knutsen@sri-unix.UUCP Newsgroups: net.puzzle Subject: C code? Unreadable? Sez who? Message-ID: <231@sri-unix.UUCP> Date: Sun, 18-Dec-83 22:15:14 EST Article-I.D.: sri-unix.231 Posted: Sun Dec 18 22:15:14 1983 Date-Received: Wed, 21-Dec-83 01:38:41 EST Lines: 22 From: Doug Landauer @ Parallel Computers Inc, Santa Cruz, CA /* ** Here's a puzzle I made up a few years ago, for those of you who ** don't think C is the same language as APL, and for all of you ** cryptography fans. The following "C" program has a (one-character) ** bug in it. Fix it. " ... and who says C code is unreadable ... "? ** (small hint (rot13)): Abj (Qrprzore) vf gur evtug gvzr bs gur lrne. */ char*l11[]={"Pp#ujh$","Gkuwy","Tgfssj","Ujlvi","Gqxvyn","Gkixm", "Tk{xm","Tgyiszo","Fkjlyn","Okqxm","Ugqxm","Fnhzjt{p","Uyhpkzo", "!ec|$ph#Djumxzti|*n{#utxi%mqyi%hcyi%uq#ng\r", "!b\"qcuxwokon*jp#b\"qgdv%uthi3\13\13","!uyr$Gthrhn'igqw", "!ujuij&uwuxqk'eqyix2\13","!gqxv%dcopntn(ckuhx2","!gkyi%hqohjt'skqkx2\13", "!tk{$hghwj&b/mc|msm3","!tgyis&tydrx&b/tylqrouo5\13","!fkjly&nclhx&b/nkoontn4", "!okqi%mcgmjy'ecqgntn4\13","!ugq$mquhx&b/mgdtntn4","!fnhzjt'qksiwy'qksmsm3\13", "!uyhp{k'etxqrky{)etxqrouo5","!bpg",0};l1l(){char*ll1,**lll,O00;for(lll=l11; *lll;lll++)for(ll1= *lll,O00=0;++ O00**ll1; ll1++){*ll1+=O00;if(*ll1<(111 >>1)+11)O00=0;}}O0O(O00){printf(l11[O00]);}main(){int ll1,lll;l1l();for(ll1= -1;ll1<11;ll1++){O0O(0); O0O(1+ll1+1); O0O(11111/0111/11); for(lll=ll1;!(lll<0);lll--)O0O(lll+1111/0111);if(ll1>=0)O0O((11111 /0111/11)<<1);O0O((1+11111/0111+1)/11);}}