[LRUG] Ruby Golf - Monday 9th May

Jonathon Horsman jonathon at arctickiwi.com
Fri May 6 08:54:20 PDT 2011


Hi Andrew

Sounds like fun. Here's some ideas for holes:

A method which replaces all unquoted new lines in a string into "<br/>"
A CSV parser which handles single and double quotes and new lines
A method which, given a letter, returns the next letter in the opposite case
(e.g. "s" returns "T", "D" returns "e", "Z" returns "a")
A password generator which creates 8 character passwords which contains no
duplicate characters
An implementation of array sort

Looking forward to it

Jonathon

On 6 May 2011 16:23, Andrew McDonough <andrew at andrewmcdonough.co.uk> wrote:

> Hi everyone,
>
> I just want to give you a bit more information about the Ruby Golf
> evening at LRUG on Monday.  As mentioned previously, you will be
> working in teams to solve 9 'holes'.  Leaving time for an introduction
> and some time at the end to collect the scores,  we will probably only
> get 45mins of coding time so the challenges will all need to be fairly
> simple (4-5 mins each).  Some other code golf competitions have
> complex scoring where each individual hole is scored with points for
> completion and number of characters relative to other teams, but to
> make sure it runs smoothly on the night, given the time constraints,
> we'll be running a really simple system:
>
> 1. The winning team must have completed all holes (with all tests
> passing).  This is more important than the character count.
> 2. Of those teams who have completed all holes, the winner is the team
> with fewest characters in the entire class (all nine holes).
> 3. We won't count whitespace in the class, to make the solutions
> easier to demonstrate.
>
> We can run further breakdowns on the mailing list afterwards, as I
> will ask people to fork the repo and commit their solutions to their
> fork.  If there are any particularly elegant solutions, we might ask
> people to demonstrate on the evening if there is spare time.
>
> So that you know exactly what you are getting, I have put an example
> course with one hole up on github:
>
> https://github.com/andrewmcdonough/rubygolf-example
>
> You'll need ruby 1.8.7 and RSpec 1.3.  If you clone the repository and
> run 'rake', you will see the tests fail.  Now have a look at the specs
> in spec/golf_spec.rb.  You need to write the method to implement the
> .hole1 method in lib/golf.rb.  When you have done this, run rake again
> to see if you have successfully completed the hole. If you complete
> the course, it will also tell you a character count.  When the course
> is passed, you can refactor to reduce the character count.
>
> As well as the LRUG ruby golf evening, James Almond from Sheffield
> Ruby User Group contacted me, and they (ShRUG) are going to run a ruby
> golf evening on the same day, possibly using the same course, so we
> can compare solutions afterwards.  We will use the same hashtag,
> #rubygolf, for both meetings.
>
> I haven't had many suggestions for holes, so if you do have any ideas
> for a simple problem that would take 4-5 minute to solve, please mail
> me off the list.  You don't need to write the specs, just describe the
> idea and if I use it, I'll give you credit at the meeting.
>
> Thanks,
>
> Andrew
>
> ---
> Andrew McDonough
> CTO, Tribesports
> http://tribesports.com
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>



-- 
Jonathon Horsman
Director - Arctic Kiwi
Mobile: 079 42366038
Web: http://www.arctickiwi.com
Twitter: http://www.twitter.com/arctickiwi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20110506/44827db6/attachment-0003.html>


More information about the Chat mailing list