Created
October 8, 2017 00:37
-
-
Save melkir/bcde023aa66bed25d5087a9c55a8f9b0 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
whichfizz = fn | |
(0, 0, _) -> "FizzBuzz" | |
(0, _, _) -> "Fizz" | |
(_, 0, _) -> "Buzz" | |
(_, _, n) -> n | |
end | |
fizzbuzz = fn(n) -> | |
whichfizz.(rem(n, 3), rem(n, 5), n) | |
end | |
IO.inspect Enum.map(1..100, fizzbuzz) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment