<div dir="ltr">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:<div><br></div><div>1: There is a GitHub repo: </div>

<div>    <a href="https://github.com/daoswald/eight-letters">https://github.com/daoswald/eight-letters</a></div><div>    <a href="https://github.com/daoswald/eight-letters.git">https://github.com/daoswald/eight-letters.git</a></div>

<div><br></div><div>Fork that repo, and proceed.</div><div><br></div><div>Here's the objective:</div><div><br></div><div>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 spell.</div>

<div><br></div><div>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:</div><div><br></div><div>my $object = EightLetters::YourName_xxxx->new( dict => $dictionary_aref );</div>

<div><br></div><div>my $letters_string = $object->letters;</div><div>my $words_spelled_int = $object->count;</div><div><br></div><div>There will be four categories of submissions:</div><div>1: Pure-Perl</div><div><br>

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

<div><br></div><div>2: By any means:</div><div><br></div><div>"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.</div>

<div><br></div><div>3: Obfu:</div><div><br></div><div>Time efficiency may not be a primary objective here.  Obfu first, efficiency second.</div><div><br></div><div>4: Golf:</div><div><br></div><div>Same as with obfu: Golf first, efficiency second (but please don't give me solutions that consume days).</div>

<div><br></div><div><br></div><div>Implementations may not cache results (even intermediate results) across object instantiations.</div><div><br></div><div>How to play:</div><div><br></div><div>Fork the repo, add your module, issue a pull request.</div>

<div>Please make sure that your module passes t/02-submission.t with less than 24 hrs processing time.</div><div><br></div><div>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).</div>

<div><br></div><div>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.</div>

<div><br></div><div>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.</div>

<div><br></div><div>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 benchmarked.</div>

<div><br></div><div>A few people inquired about the specifics of the machine I'll be testing on:</div><div><br></div><div>Intel Core i5-2300 CPU @ 2.8GHz, quad core.</div><div>SandyBridge</div><div>Ubuntu 13.10 64-bit.</div>

<div>Perl 5.18.x, threaded (perlbrew).</div><div>16GB RAM.</div><div><br></div><div>Feel free to use this list for discussion.</div><div><br></div><div>Have fun!</div><div><br></div><div><br></div></div>