473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Golf Competitions

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.
--------------
Jason Cooper
Nov 14 '05 #1
9 1750
J.L.Cooper wrote:
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.
--------------
Jason Cooper


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
Nov 14 '05 #2

"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 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
Nov 14 '05 #3
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.

--------------
Jason Cooper
Nov 14 '05 #4
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
Nov 14 '05 #5

"Dan Pop" <Da*****@cern.ch> wrote in message
news:cn**********@sunnews.cern.ch...
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 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


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


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
Nov 14 '05 #6
"J.L.Cooper" <A@A.COM> writes:
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[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv wxyz.\
\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[i]\
);}return 0;}
Nov 14 '05 #7

"Ben Pfaff" <bl*@cs.stanford.edu> wrote in message
news:87************@benpfaff.org...
"J.L.Cooper" <A@A.COM> writes:
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[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv wxyz.\ \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[i]\ );}return 0;}


This looks like frenetic break dancing. MPJ
Nov 14 '05 #8
On Fri, 12 Nov 2004 11:34:12 -0600, Merrill & Michele
<be********@comcast.net> wrote:
Then let me rephrase. Since I'm no match for any of the regulars, I shall
be Fragesteller (don't know englisch dafuer),


Questionmaster?

Chris C
Nov 14 '05 #9

"Chris Croughton" <ch***@keristor.net> wrote in message
news:sl******************@ccserver.keris.net...
On Fri, 12 Nov 2004 11:34:12 -0600, Merrill & Michele
<be********@comcast.net> wrote:
Then let me rephrase. Since I'm no match for any of the regulars, I shall be (don't know englisch dafuer),


Questionmaster?

Chris C


Fragesteller: The person who asks a question and is forbidden from answering
it himself, else said question is rhetorical. MPJ
Nov 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Simon | last post by:
Hi, I am having a little problem with my PHP - MySQl code, I have two tables (shown below) and I am trying populate a template page with data from both. <disclaimer>Now I would like to say my...
22
by: Tuang | last post by:
I'm checking out Python as a candidate for replacing Perl as my "Swiss Army knife" tool. The longer I can remember the syntax for performing a task, the more likely I am to use it on the spot if...
2
by: Mike Hoy | last post by:
hi i've been writing a golf game in text only. this was to work out some of details. it's great but making a golf course with ---'s and |||'s is kinda silly looking. (at least to some..) now...
12
by: Irene | last post by:
Hi all again, Well, I have my Athletics database with Athletes, Competitions, Scores tables. I have a ranking query where I get back the list of the competitions-athletes and scores...
4
by: DGolfer | last post by:
I have a Tabular Form which lists my score per hole in the way of "Par" "Birdie" ect. I need to create a Text box which counts the number of times "Par" is listed or each hole. EG: Form Name is:...
8
by: Blast | last post by:
I need help modeling schema for a particular issue that i've never run across before. And for the life of me, I cannot figure out how to model it - at least in a way that feels correct. Please let...
1
by: futurexnanu | last post by:
can someone please tell me where to post the codes and also wther we have any coding competitions here?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.