[LRUG] Code Golf follow up
Murray Steele
murray.steele at gmail.com
Tue Jan 15 14:12:50 PST 2019
Hi all,
Last night (Monday 14th Jan) we had our January meeting where we all donned
our plus-fours to take part in a code golf tournament. Our “course” for
the night was https://github.com/lrug/january-2019-code-golf and I think we
can all say we learned some new ruby tricks, or at the very least boggled
at some completely unparsable solutions.
The repo comes with a custom minitest runner that prints your current score
for each hole at the end of the test run. It also posts the score and
implementation to a heroku app which we used on the night to have a “live”
score table, and to explore the solutions at the end.
That app is still up at http://golf-scores.herokuapp.com/ and the code for
it lives in https://github.com/lazyatom/golf-scores if you want to take a
look.
If you missed it you can play along at home by checking out the repo and
seeing if you can beat the shortest we came up with on the night. You
almost certainly can't as one team got a score of 1 for all holes by
"kobayashi maru"-ing the process and hacking the test runner that submits
to the scoring app. Well played, team “Cheat”, well played.
There are probably shorter non-cheaty implementations to be found than we
managed on the night. If you want some inspiration of particularly cunning
approaches I think we all enjoyed hole 1 by team “nil.id”:
http://golf-scores.herokuapp.com/scores/5?hole=1 and hole 4 by team
“GoodWayToRuinAWalk”: http://golf-scores.herokuapp.com/scores/7?hole=4 and
I’m still not sure I understand hole 2 by “Team PewDiePie”:
http://golf-scores.herokuapp.com/scores/21?hole=2
If you took part on the night, or if you decide to have a go now, why not
fork the lrug repo and push up your solutions to GitHub. Let us know how
you got on.
Finally, thanks go to James Adam who organised this meeting, came up with
the holes, wrote the custom runner and the scoring app. He wasn’t able to
attend, but we appreciate all the effort he put in to prepare a fun evening
for us all. Thanks James!
Cheers,
Murray
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20190115/74d79964/attachment-0001.html>
More information about the Chat
mailing list