develooper Front page | perl.fwp | Postings from January 2002

Re: FORE! Get Even Golf Game Tees Off

Thread Previous
Piers Cawley
January 24, 2002 00:26
Re: FORE! Get Even Golf Game Tees Off
Message ID: writes:
> A test program,, and embedded below, is provided
> to help screen entries. Any program that passes the test program
> should be submitted. Especially if you suspect your program
> unsound, but it passes the test program, please submit it
> anyway! That is how we identify bugs in the test program.

I just found a bug in the test program by inspection. See below.
> -----------------------------------------------------------
> Hole 1 -- Get Even (
> Your program reads from a single input file and writes to
> stdout; you are not permitted to write anything to stderr.

The test program does not test to see what happens when is
called with multiple files as arguments. This all depends on whether
or not 'reads from a single file' is a restriction (reads from only
the one file), or a minimum condition (reads from at least one file). 

The difference makes quite a difference in terms of program length.

> -----------------------------------------------------------
> Hole 2 -- Golf Scorer (
> This is a primitive "golf scorer" program.
> You might use it to remove all newlines from a long golf program
> while writing its approximate golf score to stderr.

Again, there's no check here for calling the program with multiple
files as arguments.


   "It is a truth universally acknowledged that a language in
    possession of a rich syntax must be in need of a rewrite."
         -- Jane Austen?

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About