Golf Competitions

J

J.L.Cooper

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 any Golf
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.
 
M

Marcus Lessard

J.L.Cooper said:
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 any
Golf
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.

heheh... interesting idea but I'd find a competition over the size of the
executable better, but then again....that might be more the compilers'
fault/credit...


ml
 
M

Merrill & Michele

J.L.Cooper said:
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 any Golf
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
3) demands on memory
4) demands on CPU
MPJ
 
J

J.L.Cooper

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
3) demands on memory
4) demands on CPU
MPJ

Actually I have found that Golf competitions can really help people a lot.
When I was teaching C I found that the better way to get students to
understand why they should write in a consistent easy to read style was to
have their first tutorial question as a golf style question. then in a later
tutorial have them go back to their solution and modify to handle a slightly
different situation.
 
D

Dan Pop

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
 
M

Merrill & Michele

Dan Pop said:
In <[email protected]> "Merrill & Michele"

These are implied in such contests, when they take place in c.l.c.


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....

Then let me rephrase. Since I'm no match for any of the regulars, I shall
be Fragesteller (don't know englisch dafuer), financier and judge. The
winner is a function of my good pleasure and receives, upon specifying a
place to send $5 to, assurance that a crisp Abraham is en route bearing
sufficient postage from the United States of America.

void createnewpost(int x, int *px);

MPJ
 
B

Ben Pfaff

J.L.Cooper said:
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 any Golf
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)

I've occasionally seen informal competitions to do that here in
c.l.c. They can be kind of fun. Would you like to propose one
yourself?
 
J

jane

Ben Pfaff said:
J.L.Cooper said:
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 any Golf
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)

I've occasionally seen informal competitions to do that here in
c.l.c. They can be kind of fun. Would you like to propose one
yourself?
--
int main(void){char p[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.\
\n",*q="kl BIcNBFr.NKEzjwCIxNJC";int i=sizeof p/2;char *strchr();int putchar(\
);while(*q){i+=strchr(p,*q++)-p;if(i>=(int)sizeof p)i-=sizeof p-1;putchar(p\
);}return 0;}


This looks like frenetic break dancing. MPJ
 
M

Merrill & Michele

Chris Croughton said:
Questionmaster?

Chris C

Fragesteller: The person who asks a question and is forbidden from answering
it himself, else said question is rhetorical. MPJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top