Skip to content

Instantly share code, notes, and snippets.

@adtaylor
Forked from luxerama/fizz_buzz.rb
Last active December 21, 2015 01:49
Show Gist options
  • Save adtaylor/6231019 to your computer and use it in GitHub Desktop.
Save adtaylor/6231019 to your computer and use it in GitHub Desktop.
100.times do |i|
case
when ((i % 3) == 0 and (i % 3) == 0)
puts "FizzBuzz"
when i % 3 == 0
puts "Fizz"
when i % 5 == 0
puts "Buzz"
else
puts i
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment