Skip to content

Instantly share code, notes, and snippets.

@andrecp
Created June 16, 2017 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrecp/887483f774ef683b3b23d782e29db000 to your computer and use it in GitHub Desktop.
Save andrecp/887483f774ef683b3b23d782e29db000 to your computer and use it in GitHub Desktop.
FizzBuz in Elixir
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