Created
June 21, 2010 03:53
-
-
Save jboyens/446368 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
1 to 100 map { x => | |
(x % 3, x % 5) match { | |
case (0, 0) => "fizzbuzz" | |
case (0, _) => "fizz" | |
case (_, 0) => "buzz" | |
case _ => x.toString | |
} | |
} foreach println |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This makes a lot more sense to me now that I've learned a bit of Erlang. I didn't get far enough into Scala to understand what the underscore was doing. Don't be surprised if my Erlang FizzBuzz looks a lot like this.