Skip to content

Instantly share code, notes, and snippets.

@mxcl
Created November 27, 2010 11:53
Show Gist options
  • Save mxcl/717832 to your computer and use it in GitHub Desktop.
Save mxcl/717832 to your computer and use it in GitHub Desktop.
Improve this Fizzbuzz!
#!/usr/bin/ruby
# The Ruby FizzBuzz with the best concision versus elegance compromise.
# Fork if you have better ideas.
1.upto 100 do |n|
puts [[:fizz][n%3], [:buzz][n%5]].join[/.+/m] || n
end
@joshbuddy
Copy link

I feel like we need an obfuscated fizzbuzz contest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment