In <gd********************@comcast.com> "Merrill & Michele" <be********@comcast.net> writes:
"J.L.Cooper" <A@A.COM> wrote in message
news:cn**********@sun-cc204.lut.ac.uk... Hi,
As you can probably guess from my posts so far I enjoy doing fun and
interesting coding as a hobby. I was wondering if anyone knows of anyGolf style competitions for C? (I.e. winner is the programmer whose program
has the lowest number of characters in the source code that completes a
specific task)
If people don't know of one then perhaps we could arrange an informal
one.
Minimizing source code makes it hostile to good-programming form. If you
want golf, then I'm only too happy to offer my projects for five bucks a
skin. I would suggest that the means to judge the better project be:
1) ANSI/ISO compliance
2) portability
These are implied in such contests, when they take place in c.l.c.
3) demands on memory
4) demands on CPU
There are no universal metrics for such factors. Consider, for example,
the % operator. It is a lot more expensive on certain CPUs than on
others. And floating point arithmetic is very expensive on CPUs without
floating point support. How do you compare the demands of various
standard library function calls? Is the version using two putchar and
one puts call more or less demanding than the version using a single
printf call?
The best you can do in this area is comparing the asymptotic behaviour of
the algorithms used in terms of the number of elementary operations
performed, but then, the contest belongs to comp.programming....
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email:
Da*****@ifh.de
Currently looking for a job in the European Union