http://www.perlmonks.org?node_id=602901

In stumbling across this disturbing writeup, the author claims that not only can the majority of comp-sci majors not solve the 'fizzbuzz' problem, but he's also seen "senior" programmers take 10 or 15 minutes to solve it:

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

Naturally, I whipped out a quick snippet just to make sure I knew how to program:

$ perl -le 'for (1..100) {print("FizzBuzz"), next if not $_%15; \ print("Buzz"), next if not $_%5; print("Fizz"), next if not $_%3; prin +t}';

Since I'm lousy at golf, I figured I wouldn't try to shorten that, but I figured that a few of you might care to try a few rounds.

Cheers,
Ovid

New address of my CGI Course.