Created
June 16, 2017 05:16
-
-
Save andrecp/887483f774ef683b3b23d782e29db000 to your computer and use it in GitHub Desktop.
FizzBuz in Elixir
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 = fn | |
0, 0, c -> "FizzBuzz" | |
0, b, c -> "Fizz" | |
a, 0, c -> "Buzz" | |
a, b, c -> c | |
end | |
remainder = fn | |
n -> fizzbuzz.(rem(n, 3), rem(n, 5), n) | |
end | |
Enum.map(10..16, remainder) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment