Fun, little drills to review our knowledge of Ruby
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Let's Drill!

Just to test our knowledge of Ruby, let's solve a few puzzles.

A few of my assumptions:

  • You've been able to get Ruby up and running on your computer
  • You know how to run a Ruby script from the command line

If any of the above is untrue, please let me know.



Calculate a grade

Create a method get_letter_grade that accepts a classroom grade and returns the letter grade as a String. It should return only 'A', 'B', 'C','D', or 'F'.

get_letter_grade(90) => returns "A"

get_letter_grade(74) => returns "C"

Find the shortest string in an array

Create a function shortest_string that accepts an array of strings and returns the shortest.

shortest_string(['apple', 'car', 'yo']) => returns "yo"

shortest_string(['fargo', 'columbus', 'Indianapolis']) => returns "fargo"