# A Perl Fizzbuzz implementation that is entirely more complicated than necessary
# the Fizzbuzz is calculated based on a cyclic repetition that I noticed.
$count = 1;
for (1..100)
{
print
+($count==3 || $count==6 ? 'Fizz' :
$count==5 ? 'Buzz' :
(not $count) ? 'FizzBuzz' : $_) . $/;
$count = &cycle($count, $_);
}
sub cycle
{
($num, $pos) = @_;
$num = abs($num + ( ($pos / 7.5 % 2) ? -1 : 1));
return ($num==8 ? 7 : $num);
}