Created
October 4, 2012 22:06
-
-
Save nsfyn55/3836778 to your computer and use it in GitHub Desktop.
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
object FizzBuzzClient{ | |
def main(args: Array[String]){ | |
val fizzbuzz = for(i <- (_:Range)) yield { | |
i match { | |
case i if(i % 15 == 0) => "fizzbuzz" | |
case i if(i % 3 == 0) => "fizz" | |
case i if(i % 5 == 0) => "buzz" | |
case i if(i % 7 == 0) => "bazz" | |
case _ => i | |
} | |
} | |
fizzbuzz(1 to 100) foreach (println _ ) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment