ruby negative indices fizz buzz code example
Example: ruby negative indices fizz buzz
# Rosettacode.org has this excellent one-line FizzBuzz solution in Ruby.
# It works because Ruby allows negative indices.
1.upto(100){|n|puts'FizzBuzz '[i=n**4%-15,i+13]||n}