Skip to content

Instantly share code, notes, and snippets.

@rurabe
rurabe / rack_city.rb
Created June 13, 2012 08:17
Rack City
when 1010102050
"Rack City bitch, Rack Rack City bitch."
@rurabe
rurabe / no_in_words.rb
Created June 13, 2012 07:37
This module adds the method 'in_words' which describes an integer in english.
module InWords
def in_words
numerals = ["","one","two","three","four","five","six","seven","eight","nine"]
tens = ["","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"]
teens = %w(ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen)
powers = [""," thousand"," million"," billion"," trillion"," quadrillion"," quintillion"," sextillion"," septillion"," octillion"," nonillion"," decillion"," undecillion"," duodecillion"," tredecillion"," quattuordecillion"," quindecillion"," sexdecillion"," septendecillion"," octodecillian"," novemdecillion"," vigintillion"]
result = []
counter = 0
negative = false