note
talexb
<p>My father's a British actuary, so growing up we had an amusing variation on this game, often played in the car during long trips. In addition to 'fizz' (3) and 'buzz' (5) we would also play with 'sausage' (7) to make the game a bit more challenging.</p>
<p>Of course, after someone had made a mistake, they had to drop out, which changed what order the fizz, buzz or sausage came around to you. And I don't think we ever made it as far as the first 'fizz-buzz-sausage' -- 105.</p>
<div class="pmsig"><div class="pmsig-131279">
<p>Alex / [talexb] / Toronto</p>
<p><small>"<a alt="GrokLaw, by Pamela Jones" href="http://www.groklaw.net">Groklaw</a> is the open-source mentality applied to legal research" ~ Linus Torvalds</small></p>
</div></div>
<p><b>Update:</b> OK, let's see if I can pass the code testing bit:
<c>
#!/usr/bin/perl -w
use strict;
{
for (1..100) {
my @a;
push(@a,'fizz') if ($_%3==0);
push(@a,'buzz') if ($_%5==0);
push(@a,'sausage') if ($_%7==0);
if (@a) {
print join(' ',@a) . "\n";
} else {
print "$_\n";
}
}
}
</c>
OK, except for a typo (I had 6 instead of 7) it worked first time. I guess I'm not too thumb-fingered.</p>
<p><b>ps</b> No, that was obviously *not* golfed. ;)</p>
602901
602901