Skip to content

Instantly share code, notes, and snippets.

@daryllxd
Created March 27, 2017 10:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daryllxd/a518b0cd5212b13dc4ba3baa082cdc76 to your computer and use it in GitHub Desktop.
Save daryllxd/a518b0cd5212b13dc4ba3baa082cdc76 to your computer and use it in GitHub Desktop.
elixir
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