Skip to content

Instantly share code, notes, and snippets.

@tatzyr
Created October 10, 2011 04:26
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 tatzyr/1274633 to your computer and use it in GitHub Desktop.
Save tatzyr/1274633 to your computer and use it in GitHub Desktop.
http://goo.gl/t6U1J を見て慣れないPerlを使って12分で書いたFizzBuzz
#!/usr/bin/env perl
use strict;
use warnings;
local ($,, $\) = ("\n", "\n");
print map{
if ($_ % 15 == 0) {
"FizzBuzz"
} elsif ($_ % 3 == 0) {
"Fizz"
} elsif ($_ % 5 == 0) {
"Buzz"
} else {
$_
}
} (1..shift);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment