Created
March 27, 2017 10:13
-
-
Save daryllxd/a518b0cd5212b13dc4ba3baa082cdc76 to your computer and use it in GitHub Desktop.
elixir
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
fizzbuzz = fn (a, b, c) -> | |
case { a, b, c } do | |
{ 0, 0, _ } -> "fizzbuzz" | |
{ 0, _, _ } -> "fizz" | |
{ _, 0, _ } -> "buzz" | |
_ -> c | |
end | |
end | |
rem_fiz = fn(num) -> | |
fizzbuzz.(rem(num, 3), rem(num, 5), num) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment