📜  ruby 负索引发出嗡嗡声 - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:48.401000             🧑  作者: Mango

代码示例1
# 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}