2 log
= Logger
.new(STDERR)
3 log
.level
= Logger
::WARN
35 def words_of_number(n
)
40 [$words[n
.div(10) * 10], $words[n
% 10]]
42 [$words[n
.div(100)], 'hundred'] + (n
% 100 == 0 ? [] : ['and'] + words_of_number(n
% 100))
51 words
+= words_of_number(i
)
52 log
.info
{ "Number #{i} gives words #{words_of_number i}" }
55 puts words
.join('').length