Created
February 15, 2012 15:01
-
-
Save timfernando/1836400 to your computer and use it in GitHub Desktop.
List comprehension 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
fizzbuzz = (x) -> | |
if x%3 is 0 and x%5 is 0 | |
"fizz bang" | |
else if x%3 is 0 | |
"fizz" | |
else if x%5 is 0 | |
"bang" | |
else -> | |
x | |
console.log (fizzbuzz i for i in [1..100]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment