Skip to content

Instantly share code, notes, and snippets.

@idlehands
idlehands / num_words_pair.rb
Created October 11, 2012 19:26
num_words_pair
@answer_string = ""
ONE_TO_NINETEEN = {1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six',
7 => 'seven', 8 => 'eight', 9 => 'nine', 10 => 'ten', 11 => 'eleven', 12 => 'twelve',
13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen', 16 => 'sixteen',
17 => 'seventeen', 18 => 'eighteen', 19 => 'nineteen'
}
TENS = {100 => ' hundred ', 90 => 'nintey', 80 => 'eighty', 70 => 'seventy',
60 => 'sixty', 50 => 'fifty', 40 => 'forty', 30 => 'thirty', 20 => 'twenty', 1000 => " thousand "
}
@idlehands
idlehands / roman_pt_I.rb
Created October 5, 2012 19:59
DBC Level 1 Roman numerals challenge PT 1
def roman_numerals(num)
arabic_numbers = [1000, 500, 100, 50, 10, 5, 1]
raw_roman_numbers = []
#POPULATE ARRAY WITH CORRECT NUMBERS IN ARABIC FORM
unless num == 0
arabic_numbers.each do |i|
if i <= num
(num/i).times do
# Put your answers here!
Last login: Sat Oct 6 16:04:39 on ttys001
JEFFREYs-MacBook-Pro:~ jeffrey$ rvm list
rvm rubies
ruby-1.8.7-p370 [ i686 ]
ruby-1.9.2-p290 [ x86_64 ]
ruby-1.9.3-p194 [ x86_64 ]