GitXplorerGitXplorer
t

ruby_golf_hamburg_2013

public
0 stars
11 forks
0 issues

Commits

List of commits on branch master.
Unverified
ea033bc77401131250ce1d9a057503bdaf79500a

Do the aftermath

tthomasjachmann committed 11 years ago
Unverified
2cf2b59857e522a7507dc62a511e4c4d7200a03e

Add golfer's best solutions

tthomasjachmann committed 11 years ago
Unverified
1c4618b44817492a4509cd2fb3c4c8ff5bda6cec

Ready, Set, GO!

tthomasjachmann committed 11 years ago
Unverified
862f45e33bbb6546d02eff518889d1b9ee1a0d4f

Update metrics gem

tthomasjachmann committed 11 years ago
Unverified
262beaffd68e30f28c6bb7298208d76ec9d61410

Update metrics gem

tthomasjachmann committed 11 years ago
Unverified
5de8aa2f337f61baddb607d37d30889242f5469e

Add encoding headers

tthomasjachmann committed 11 years ago

README

The README file for this repository.

Ruby Golf Hamburg, 13.11.2013

We had the second Ruby Golf competition this year. Our goal was to compute a score for each hole and provide a web site to check live rankings. See axelerator/ruby_caddy for the Rails app used to compute the scores and display the ranking.

Ranking

An honorable mention of the most effective solution in the category "Gaming The System" goes to team Peter Schröder who put their code inside the method signature and thus managed to get down to 1 character per method most of the time. Great idea, but too far off for being counted as a real implementation. Also because it mainly was an input/output mapping, no algorithmic implementation. So we had to disqualify this entry.

  1. Tammo & Timo (Also "Gaming The System" since all code was converted to whitespace which could be evaluated on runtime. Since all whitespace is eliminated for counting, the solutions all have the same length which is the code for evaluating the whitespace. Cheaty, but still this implemented the tasks we asked for.)
  2. Team Schröder 2 (An alter ego of team Peter Schröder providing their solution before they became too creative.)
  3. Jan
  4. Marc
  5. anton
  6. Daniel
  7. Thomas von Deyen
  8. Ben
  9. Tim

If you check ruby_golf.rb, you'll find a compilation of the shortest non cheating solutions from all golfers:

  • Hole 1: 33 characters from Daniel
  • Hole 2: 43 characters from Jan
  • Hole 3: 62 characters from Daniel
  • Hole 4: 98 characters from Jan
  • Hole 5: 24 characters from Jan and Thomas von Deyen
  • Hole 6: 117 characters from Jan
  • Hole 7: 110 characters from Jan
  • Hold 8: 138 characters from Jan

Let me say that without any cheating, Jan probably would have won.

Learnings

  • Don't exclude whitespace completely, maybe just the initial indentation.
  • Don't ignore method signature in counting characters.
  • Test with more examples to avoid quickfix solutions not implementing the proper algorithm and prevent simple input/output mappings instead of real code.
  • Check code during competition and give hints what to avoid.
  • Try to even out team sizes since bigger teams definitely have an advantage.

Competition

To start coding on this challenge, first install all gems:

bundle install

Then, execute the test using guard:

bundle exec guard

Each time you change ruby_golf.rb, the tests are re-run and give you the state of your implementation and code metrics used for ranking.

Rules

  • only touch ruby_golf.rb
  • implement your solution within the pre-defined module methods
  • only non-whitespace characters within the method body are counted, no need to optimize the method definition
  • you can implement helper methods within the module, but be aware that they are counted towards the size of each method they're used in
  • stick to what stdlib gives you
  • DON'T use custom gems
  • DON'T go and annoy the organizers by being clever and exploiting their code