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
The winning entry is at 56 bytes and I can’t get below 65 bytes with the
I think if the substring indices could be computed mathematically
instead of logically, it might work, but it’s possible an entirely new
approach is necessary.
It works correctly, so to see acceptable output, just run it.
Can any Ruby guru out there get it down to 56 bytes?