Skip to content

Latest commit

 

History

History
86 lines (54 loc) · 2.27 KB

README.md

File metadata and controls

86 lines (54 loc) · 2.27 KB

Ruby FTW March Kata Competition

March 25, 2014

Rules

  1. No purchase necessary
  2. Must be present to win.
  3. Team must consist of two people or fewer.
  4. Prizes will be awarded based on an objective "correctness" score and a subjective "style" score.
  5. No external libraries, only what is available in Ruby core and stdlib
  6. Each team will have 45 minutes to complete as many challenges as possible.

Prizes

For each team member:

  • One (1) Fancy Oven Bits American Apparel Shirt (M, L, 2XL)
  • One (1) $10 Amazon Gift Card

Submission

  1. Form a team of one or two
  2. Fork this repository on GitHub
  3. Commit your solution(s)
  4. Send a pull request

Scoring

Prizes will be awarded based on an objective "correctness" score component and a subjective "style" score component. Each are out of 100 points and will be averaged to provide the final score.

Correctness Component

Each problem is worth a total number of objective points. The points will be awarded during running test cases that have not been made publicly available during development.

Subjective Component

The other participants will submit a style score between 1 and 100. The highest and lowest scores will be excluded from an average of all scores to provide the subjective component.

Requirements

  • Ruby 2.1.1 (can develop in other versions but will be tested against 2.1.1p76)

Problems

To run the test cases for each problem:

$ ruby spec/kata/KATA_NAME_spec.rb

1. Snail Sort (25 points)

Given a two-dimensional array, sort like this:

It should allow for differing lengths of sub-arrays, filling in nil where there are no elements.

2. Palindrome Validator (25 points)

Return true if the given string is a palindrome. It should be case-insensitive and ignore all non-alphanumeric characters.

palindrome?("racecar") # => true
palindrome?("A man, a plan, a canal: PANAMA!") # => true
palindrome?("Snake achings") # => false

3. Method Chain Calculator (50 points)

Add, subtract, multiply, and divide numbers between 1 and 20 using a method chaining technique like this:

Calc.new.twenty.plus.seven  # => 27
Calc.new.seven.times.eight  # => 56
Calc.new.three.minus.twelve # => -9