FizzBuzz in ruby in one line
Some days back I came accross this blog which says about writing the classic fizzbuzz program in one line using Haskell. So that inspired me about writing a single line FizzBuzz program in Ruby. So here you go. This is the code that I came out with. puts (1..100).map{|i|i%3*i%5==0?(i%3==0?"Fizz":"")+(i%5==0?"Buzz":""):i.to_s}.join(",") Do let me know if you can come out with something even smaller