[Saltlake-pm] Code challenge details

David Oswald daoswald at gmail.com
Tue Jan 14 22:11:54 PST 2014

Tuesday evening at Salt Lake Perl Mongers we were given a code challenge.
 Even if you didn't make it to the meeting you may still participate.  Here
are the details:

1: There is a GitHub repo:

Fork that repo, and proceed.

Here's the objective:

Derive which eight letters will spell the most words from the dictionary
supplied in the challenge's repo.  Find, also, how many words those letters

Your task is to write a module with an OO interface that finds the answer
to these questions in as little time as possible.  The module must provide
the following interface:

my $object = EightLetters::YourName_xxxx->new( dict => $dictionary_aref );

my $letters_string = $object->letters;
my $words_spelled_int = $object->count;

There will be four categories of submissions:
1: Pure-Perl

Pure-Perl is any submission that is written in pure-Perl.  The submission
may use *any* core-Perl module, and any pure-Perl CPAN module.  There is an
explicit allowance for List::MoreUtils, even though it's not pure-Perl.
It's so ubiquitous that we decided to allow it.

2: By any means:

"By any means" means that as long as I can install with a reasonable level
of effort the modules your implementation uses, or the external tools it
uses (compilers, databases, etc.), and as long as it can be called using
the Perl OO interface described above, it will be allowed.  I realize
"reasonable level of effort" is subjective, but I'm really trying to
encourage creativity in this category, and will try my best to keep up with
dependencies as long as they don't take over my system, or too much of my
own time.

3: Obfu:

Time efficiency may not be a primary objective here.  Obfu first,
efficiency second.

4: Golf:

Same as with obfu: Golf first, efficiency second (but please don't give me
solutions that consume days).

Implementations may not cache results (even intermediate results) across
object instantiations.

How to play:

Fork the repo, add your module, issue a pull request.
Please make sure that your module passes t/02-submission.t with less than
24 hrs processing time.

You may fork and pull as often as you like.  I'll probably apply pull
requests once per day.  Your submissions aren't final until I announce that
we're going to start judging (probably a week before our next meeting, and
I'll give advance notice).

The GitHub repo has a set of slides in Libre/OpenOffice format that provide
additional details.  The repo also contains a Moo based role, as well as a
Moo template class that you might use as a starting point if you prefer
doing things the Moo(sey) way.  But a class using blessed references is
fine too, as long as it conforms to the interface specified above.

Be sure to look at the scripts in the repo's bin/ directory to see how to
obtain the dictionary and pass it to your object.  Also, dump the
dictionary to your screen to determine any pre-processing your object might
need to do.

Please note: The dictionary is passed by reference for efficiency's sake;
please don't modify the contents of that array ref within your class; I'd
rather not re-instantiate the dictionary for every submission being

A few people inquired about the specifics of the machine I'll be testing on:

Intel Core i5-2300 CPU @ 2.8GHz, quad core.
Ubuntu 13.10 64-bit.
Perl 5.18.x, threaded (perlbrew).

Feel free to use this list for discussion.

Have fun!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/saltlake-pm/attachments/20140114/5e21475f/attachment.html>

More information about the Saltlake-pm mailing list