Module: FizzBuzzer::V11
- Defined in:
- lib/fizzbuzzer.rb
Instance Method Summary collapse
Instance Method Details
#fizzbuzz ⇒ Object
301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/fizzbuzzer.rb', line 301 def fizzbuzz result = [] for n in 1..100 do result << if n % 3 == 0 && n % 5 == 0 then "FizzBuzz" elsif n % 3 == 0 then "Fizz" elsif n % 5 == 0 then "Buzz" else n end end result end |