2013-04-10 21:29:02 -07:00
|
|
|
def print_happy
|
|
|
|
|
happy_numbers = []
|
|
|
|
|
|
2015-02-20 00:35:01 -05:00
|
|
|
1.step do |i|
|
2013-04-10 21:29:02 -07:00
|
|
|
break if happy_numbers.length >= 8
|
|
|
|
|
happy_numbers << i if happy?(i)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
p happy_numbers
|
|
|
|
|
end
|
2015-02-20 00:35:01 -05:00
|
|
|
|
|
|
|
|
print_happy
|