This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 " | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 ] |
NewerOlder