Skip to content

Instantly share code, notes, and snippets.

@mileszs
Last active December 21, 2015 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mileszs/25a67ea8a85335bc6717 to your computer and use it in GitHub Desktop.
Save mileszs/25a67ea8a85335bc6717 to your computer and use it in GitHub Desktop.
Indy.rb Bio Code Golf Rules and Other Info

Indy.rb's Bio Code Golf

(2013-8-14)

Tonight we are code-golfing, with a bioinformatics slant. What is code golf?

Code golf is a type of recreational computer programming competition in which participants strive to achieve the shortest possible code that implements a certain algorithm.

Sound intimidating? It's not. The ultimate goal is to write answers to the problems with the fewest characters you can. A good way to get there is to write an answer that works, and then make it shorter.

Rules and Other Information

  1. Split into groups. Please aim for an even mix of advanced, intermediate, and beginner. (Experts, please invite a couple beginners to join you.)
  2. Your code must pass the test included with the problem.
  3. You may only use Ruby (1.9.3+, please) and the Ruby Standard Library in the actual problem code. No other gems! (You may use a debugger such as 'pry' as necessary.)
  4. Each problem's method should be named after its number, e.g. problem_1(), problem_2(), etc.).
  5. Method definition lines wil be removed before calculating the total character count.
  6. To enter, put your code in a Gist, Pastie, or whatever your favorite code pasting tool might be. Then email the link to miles@getfretless.com with the subject line of the form Problem N (e.g. a subject of "Problem 1" for problem 1).
  7. Once we've finished one round, we will move right along to the next round. I will announce the results at the end of all the rounds.
  8. The winning team will be the team with the overall lowest score across all rounds.
  9. Each round will be 15 minutes, but I reserve the right to extend rounds as I see fit.
  10. Most importantly, you should pick a creative team name. Send it to me in your first email (Problem 1)!
@codatory
Copy link

By popular demand, here's an example:

Return an array of all even integers from 1 to 10

Reference Implementation:

(1..10).select(&:even?)

Winner:

[2,4,6,8,10]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment