Skip to content

Instantly share code, notes, and snippets.

@mathias
Created December 25, 2010 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathias/755054 to your computer and use it in GitHub Desktop.
Save mathias/755054 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby -wKU
## Attempt 1:
1.upto(100) { |num|
if (num % 3) == 0 && (num % 5) == 0
puts "FizzBuzz"
elsif (num % 3) == 0
puts "Fizz"
elsif (num % 5) == 0
puts "Buzz"
else
puts num
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment