-
Notifications
You must be signed in to change notification settings - Fork 60
/
to_english.rb
28 lines (24 loc) · 965 Bytes
/
to_english.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Method name: to_roman
# Inputs: A number
# Returns: A String representing the number in English
# Prints: Nothing
# Write a method that takes a positive integer as input and returns the input
# in "plain English." For example,
#
# to_english(1) == "one"
# to_english(12) == "twelve"
# to_english(123) == "one hundred twenty three"
# to_english(1234) == "one thousand two hundred thirty four"
# to_english(12345) == "twelve thousand three hundred forty five"
#
# You can decide the largest power of 10 you wish to support, but you should
# support at least up to the billions.
# Hint #1
# Write down a bunch of examples and look for patterns.
# What words make up "special cases?" There are likely fewer than you think
# if you can find ways to combine simpler patterns into larger ones.
def to_english(string)
end
if __FILE__ == $PROGRAM_NAME
# Hey, there are a bunch of lovely test cases above. Start with those. :)
end