From: Brian Adkins Date: 2007-03-03T12:15:06+09:00 Subject: Re: Smallest FizzBuzz program 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) I submitted the resulting program to the site (which is back up now) under 'comp.lang.ruby' since multiple people contributed. Comes in at 57 bytes - only 1 byte longer than the best. So apparently the site does count the EOF byte. 1.upto(?d){|i|i%3<1&&x=:Fizz;puts i%5<1?"#{x}Buzz":x||i} http://golf.shinh.org/p.rb?FizzBuzz Interestingly, the following Ruby program (with a little help from sed that my friend passed along) comes in at exactly 56 bytes, but the test site rightfully failed it due to the attempt to shell the command: puts `seq 100|sed -e'5~5s/.*/Buzz/;3~3s/^[0-9]*/Fizz/'`