#!/usr/local/bin/ruby (1..30).map do |i| res = [] res << 'Fizz' if i%3 res << 'Buzz' if i%5 res.empty? ? i : res.join end