Skip to content

Instantly share code, notes, and snippets.

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