Created
October 9, 2011 11:55
-
-
Save KOBA789/1273584 to your computer and use it in GitHub Desktop.
CoffeeScript で FizzBuzz
This file contains hidden or 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
| fizzbuzz = (num) -> | |
| if num % 15 == 0 then 'FizzBuzz' | |
| else if num % 3 == 0 then 'Fizz' | |
| else if num % 5 == 0 then 'Buzz' | |
| else num | |
| console.log (fizzbuzz num for num in [1..100]).join('\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment