Last active
August 21, 2017 15:29
-
-
Save Biacco42/74796117c2015d1d8ec74dcadd48643a to your computer and use it in GitHub Desktop.
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
object FizzBuzz { | |
def main(args: Array[String]) { | |
val fizzbuzz = (1 to 100).map { i => | |
(i % 3, i % 5) match { | |
case (0, 0) => "fizzbuzz" | |
case (0, _) => "fizz" | |
case (_, 0) => "buzz" | |
case _ => i.toString | |
} | |
} | |
fizzbuzz.foreach { println } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment