::: Area #157 (comp.sys.acorn.programmer) Message: #28291 (Read 10 times, has 0 replies, 2028 bytes) Date : Sun Feb 1 03:21:54 1998 From : Steven Singer of fidonet#2:254/27.2 To : All Subject: Re: Basic programming Nelson Sandalwood (bayliss@ihug.co.nz) wrote: : KaB>: > We stopped when we got a clean compile on the following syntax : KaB>: > : KaB>: > for(;P("\n"),R-;P("|"))for(e=C;e-C);P("_"+(*u++/8)%2))P("|"+(*u/4)%2 : KaB>: > ); : KaB>: However, correct me if I am wrong, that's not legal C. : I think you have all missed the point, if the letter was/is for real then the : above line of /code/ is supposed to be giberish. Thats the whole point, that : they had made C so complex and full of BS that it would actually accept that : line... Bzzzt, and thank you for playing. The line is from a real C program, it has just been mistyped somewhere along its travels (perhaps deliberately, though I would have thought leaving the line as is would have been better). It should be: for(;P("\n"),R--;P("|"))for(e=C;e--;P("_ "+(*u++/8)%2))P("| "+(*u/4)%2); ^ ^ ^ ^ (The ^s mark the differences). The original letter was published in an April 1st issue of Computerworld (I don't know which year), so it's probably been retyped by hand a few times. Interestingly enough, I have a copy of the same letter in computer readable form, and the line quoted in my copy is also wrong, but it's wrong in different ways: for(;P("\n"),R=;P("|"))for(e=C;e=;P("_"+(*u++/8)%2))P("| "+(*u/4)%2); ^ ^ ^ The program this was taken from was the grand prize winner of the 1985 obfuscated C code competition and was written by Carl Shapiro. See http://reality.sgi.com/csp/ioccc/ for more truly wonderful examples of C. - Steven PS. The Newsgroups line of this thread appears to have been truncated somewhere along the way, but this is probably a good thing. --- EchoMaker 0.46 * Origin: The Arcade BBS Usenet News Gateway (2:254/27.2)