Portable Self-Replicating C Contest

Karl Heuer karl at haddock.ima.isc.com
Wed Apr 12 02:33:36 AEST 1989


In article <6647 at bsu-cs.bsu.edu> dhesi at bsu-cs.UUCP (Rahul Dhesi) writes:
>In article <12593 at haddock.ima.isc.com> karl at haddock.ima.isc.com (Karl Heuer)
>writes [that contest entries must use trigraphs]
>
>I'm curious to know:  What is the purpose of the rule above?  All
>it will do is make submitted programs harder to read, and nearly
>impossible to make sense of in a casual scan.

It makes the problem more challenging.  Note that a program which satisfies
all of the rules except this one is not self-reproducing after a naive
conversion to trigraphs, because `printf("??=")' will output `#', not `??='.
(One correct fix is to use `printf("?\?=")', but since `\' is itself a
trigraphable character, this must be written `printf("???/?=")'!)

Yes, it's hard to read, but one pass through a detrigraphing sed script will
fix that, as I did with your text before quoting it above.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.std.c mailing list