From: vsv Date: 2007-03-03T04:15:07+09:00 Subject: Re: Smallest FizzBuzz program On Mar 2, 11:06 am, Brian Adkins wrote: > This is really bugging me. Someone posted a golf challenge to write a > smallest FizzBuzz program here: > > http://golf.shinh.org/p.rb?FizzBuzz (although the site was down when I > checked it a few minutes ago) > > Basically, the challenge is to write the smallest Ruby program that will > print the numbers from 1 to 100 except: > * substitute Fizz for numbers that are multiples of 3 > * substitute Buzz for numbers that are multiples of 5 > * substitute FizzBuzz for numbers that are multiples of both 3 and 5 .. > Can any Ruby guru out there get it down to 56 bytes? 55 bytes: 1.upto(?d){|i,x|i%3<1&&x=:Fizz;puts i%5<1?"#{x}Buzz":i} Replace ?d with 100 if you want 56 bytes :)