Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!cs.utexas.edu!rutgers!att!alberta!c415-23 From: c415-23@alberta.UUCP (Morris Barbara L) Newsgroups: comp.lang.c Subject: Re: programming challenge (silly) Summary: Ground rules (or lack thereof) Message-ID: <2109@jasper.UUCP> Date: 7 Mar 89 22:30:22 GMT References: <2102@jasper.UUCP> <9789@smoke.BRL.MIL> Distribution: na Organization: U. of Alberta, Edmonton, Alberta, Canada Lines: 21 In article <9789@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: > >The best I could do with approximately-portable C was 105 characters. >(Fully-portable C requires the addition of "#include".) >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. 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 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