Last active
December 31, 2015 09:59
-
-
Save pera/7970159 to your computer and use it in GitHub Desktop.
FizzBuzz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print+(join'',("FizzBuzz"=~/./g)[$_**2%3*4..7-$_**4%5*4])||$_,$/for 1..100; | |
print+($_,'Fizz','Buzz','FizzBuzz')[!($_%3)|!($_%5)<<1].$/for 1..100; | |
print+($_,'Fizz','Buzz','FizzBuzz')[!($_%3)+!($_%5)*2].$/for 1..100; | |
print+($_%15?$_%5?$_%3?$_:'Fizz':'Buzz':'FizzBuzz').$/for 1..100; | |
print+('Fizz')[$_%3].('Buzz')[$_%5]||$_,$/for 1..100; #it may give warnings | |
print'Fizz'x!($_%3).'Buzz'x!($_%5)||$_,$/for 1..100; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment