Last active
August 29, 2015 14:13
-
-
Save tdantas/3a862c65f5a84e2c7d0b to your computer and use it in GitHub Desktop.
fizzbuzz 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
defmodule FizzBuzz do | |
defp run(0, 0, _), do: "FizzBuzz" | |
defp run(0, _, _), do: "Fizz" | |
defp run(_, 0, _), do: "Buzz" | |
defp run(_, _, z), do: z | |
def of(n), do: run( rem(n,3), rem(n,5), n) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment