Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Fizz Buzz Test
# http://c2.com/cgi/wiki?FizzBuzzTest
fizz_buzz = fn
(0, 0, _) -> "FizzBuzz"
(0, _, _) -> "Fizz"
(_, 0, _) -> "Buzz"
(_, _, x) -> x
end
Enum.map 1..100, fn(n) ->
IO.puts fizz_buzz.(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
You can’t perform that action at this time.