Asher was very proud at how he had captured so much rubyness in his fizzbuzz solution.
#!/usr/bin/env ruby
class Integer
def mod3
return self % 3
end
def mod5
return self % 5
end
end
class String
def fizzbuzz
if self.to_i.mod3 == 0 and self.to_i.mod5 == 0
return 'fizzbuzz'
elsif self.to_i.mod3 == 0
return 'fizz'
elsif self.to_i.mod5 == 0
return 'buzz'
else
return self
end
end
end
(1..100).each do |num|
puts num.to_s.fizzbuzz
end
Dan loves the way Ruby appeals to his DIY side. He just wishes all those kids in the community would stop reinventing the wheel all the time. If there is one thing Dan knows, it is wheels.
When Davener saw this he shouted, “oh hell yes!” as he reblogged it, adding “Ruby vs anything else!” in all caps.
Zep, having traveled the world, seen many things and solved outrageous problems, was simply unable to fathom why he could not get a reliable exit status from his gem. Thus, he proceeded as if nothing at all were wrong.
Unexpectedly and without warning, the mirror where she would get the needed gems was gone, dashing Belle’s plans for a weekend of blissful Ruby coding.
Tad experienced a deep sense of satisfaction, as both a father and a programmer, the day little December started to appreciate the beautiful simplicity of his Ruby code.
With the girls at school, and his wife away at a day spa, Dirk realized that it was the perfect day to call in sick and spend some quality time working on his epic home automation rails app.
Charlene was beginning to question just how much company time Arnold was spending on his “little” Ruby side projects.
Audra admired the beauty of her gem, written the night before, long after her breakfast was cold.