programming challenge (silly)

Morris Barbara L c415-23 at alberta.UUCP
Wed Mar 8 08:30:22 AEST 1989


In article <9789 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>
>The best I could do with approximately-portable C was 105 characters.
>(Fully-portable C requires the addition of "#include<stdio.h>".)
>There are several ways to "cheat", e.g. cc -Dp=printf, system(), etc.
>What are the ground rules?

There are no rules, really, but we didn't care about "fully portable" so
there is no need to #include<stdio.h>.  cc -Dp=printf is a good idea,
but why not carry it further and try doing the whole program on the
command line except for the printf strings?  Of course if you do that
the record will plummet from around 90-100 characters to around 20.

So, in case anyone is taking this seriously, I propose the following rules:
1. No command line arguments for the compiler or the program
2. Don't worry about #include <stdio.h>
3. The program must mimic the original in every way - if it takes several
   minutes to report an error for input of -1, it's not quite the same
   as the original.

- Barbara Morris



More information about the Comp.lang.c mailing list