Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Fixnum
- def fizzbuzz
- if self % 3 == 0 && self % 5 == 0
- return "fizzbuzz"
- elsif self % 5 == 0
- return "buzz"
- elsif self % 3 == 0
- return "fizz"
- else
- return self
- end
- end
- end
- big_buzz = []
- 1001.times do |n|
- big_buzz << n.fizzbuzz
- end
- puts big_buzz
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement