No nested if's (and no ternary operators):
def fizzbuzz(n) (1..100).each do |n| res = "" res << "Fizz" if n % 5 == 0 res << "Buzz" if n % 3 == 0 res << n.to_s if res.empty? puts res end end With one extra line of code this transforms to a FizzBuzzBazz.