Created
November 18, 2015 03:08
-
-
Save rekyuu/c6b721c9d9c803ed7270 to your computer and use it in GitHub Desktop.
Elixir 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
| fizzword = fn | |
| (0, 0, _) -> "fizzbuzz" | |
| (0, _, _) -> "fizz" | |
| (_, 0, _) -> "buzz" | |
| (_, _, n) -> n | |
| end | |
| fizzbuzz = fn (n) -> | |
| fizzword.(rem(n, 3), rem(n, 5), n) | |
| end | |
| IO.inspect Enum.map(1..50, fizzbuzz) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment