Module: FizzBuzzer::V13
- Defined in:
- lib/fizzbuzzer.rb
Instance Method Summary collapse
Instance Method Details
#fizzbuzz ⇒ Object
378 379 380 381 382 383 384 385 |
# File 'lib/fizzbuzzer.rb', line 378 def fizzbuzz fizzy = [nil, nil, :Fizz].cycle buzzy = [nil, nil, nil, nil, :Buzz].cycle (1..100).map do |n| "#{fizzy.next}#{buzzy.next}"[/.+/] || n end end |