FizzBuzz Solution Dumping Ground

My weapon of choice is Ruby

1.upto(100) do |i|
  out = nil
  out = out.to_s + 'Fizz' if i % 3 == 0
  out = out.to_s + 'Buzz' if i % 5 == 0
  puts out || i
end

And did you really think you could say “only 0.5% of programmers can write FizzBuzz” without people showing you how they do it? :stuck_out_tongue:

1 Like