Skip to content

Instantly share code, notes, and snippets.

@gmgent
Created October 29, 2011 20:12
Show Gist options
  • Save gmgent/1325022 to your computer and use it in GitHub Desktop.
Save gmgent/1325022 to your computer and use it in GitHub Desktop.
fizzbuzz.rb
for x in 1..100 do
if (x % 3 == 0) && (x % 5 == 0)
puts "fizzbuzz"
elsif (x % 3 == 0)
puts "fizz"
elsif (x % 5 == 0)
puts "buzz"
else
puts x
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment