Skip to content

Instantly share code, notes, and snippets.

@joshuastr
Created April 27, 2016 01:26
Show Gist options
  • Save joshuastr/156bb3ff5b7b752e4cb303ef015683d7 to your computer and use it in GitHub Desktop.
Save joshuastr/156bb3ff5b7b752e4cb303ef015683d7 to your computer and use it in GitHub Desktop.
def fizzbuzz(x,y)
(x..y).each do |i|
case
when i % 15 == 0 then puts "FizzBuzz"
when i % 3 == 0 then puts "Fizz"
when i % 5 == 0 then puts "Buzz"
when i % 7 == 0 then puts "Fizzzzzzz"
else
end
end
end
fizzbuzz(20,200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment