Skip to content

Instantly share code, notes, and snippets.

@nickserv
Created May 30, 2013 06:32
Show Gist options
  • Save nickserv/5676052 to your computer and use it in GitHub Desktop.
Save nickserv/5676052 to your computer and use it in GitHub Desktop.
A simple FizzBuzz implementation in one line of Ruby
(1..100).each { |i| puts((i%3==0 ? "Fizz" : "") + (i%5==0 ? "Buzz" : "") + ((i%3!=0 and i%5!=0) ? i.to_s : "")) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment