Skip to content

Instantly share code, notes, and snippets.

@jumph4x
Created March 29, 2012 01:54
Show Gist options
  • Save jumph4x/2232399 to your computer and use it in GitHub Desktop.
Save jumph4x/2232399 to your computer and use it in GitHub Desktop.
I love your feet Ryan
GRADES = ['A', 'B', 'C', 'D']
def grade_formula(book_count, reads_books = true)
raise "One cannot have read a negative amount of books, you numbnuts." if book_count < 0
index = case book_count
when 0..9
3
when 10..20
2
else
1
end
index -= 1 if reads_books
GRADES[index]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment