Skip to content

Instantly share code, notes, and snippets.

@argrath
Created March 4, 2022 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save argrath/cf46879e26ce6979bdb3ddb0990bbae7 to your computer and use it in GitHub Desktop.
Save argrath/cf46879e26ce6979bdb3ddb0990bbae7 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use utf8;
my @result = (
undef, 'Fizz', 'Buzz', 'FizzBuzz',
'セブン', undef, undef, undef,
'イレブン', undef, undef, undef,
'セブンイレブン', undef, undef, 'いい気分',
);
for(my $i = 1; $i <= 2000; $i++){
my $f = 0;
if($i % 3 == 0){
$f += 1;
}
if($i % 5 == 0){
$f += 2;
}
if($i % 7 == 0){
$f += 4;
}
if($i % 11 == 0){
$f += 8;
}
my $r = $result[$f] // $i;
print $r . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment