Skip to content

Instantly share code, notes, and snippets.

@scottfirestone
Created December 1, 2015 16:46
Show Gist options
  • Save scottfirestone/a4d41579babd51b72994 to your computer and use it in GitHub Desktop.
Save scottfirestone/a4d41579babd51b72994 to your computer and use it in GitHub Desktop.
def superfizzbuzz
0.upto(1000).each do |num|
if (num % 7 ==0) && (num % 5==0) && (num % 3==0)
puts "SuperFizzBuzz"
elsif (num % 7 ==0) && (num % 3==0)
puts "SuperFizz"
elsif (num % 7 ==0) && (num % 5==0)
puts "SuperBuzz"
elsif num % 3 ==0
puts "Fizz"
elsif 3==0
puts "Buzz"
elsif num % 7 ==0
puts "Super"
else
puts num
end
end
end
superfizzbuzz()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment