Created
December 10, 2015 02:23
-
-
Save iorionda/6894ee3d32e2bb37e986 to your computer and use it in GitHub Desktop.
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
fizzbuzz = fn | |
{true, true} -> 'FizzBuzz' | |
{true, false} -> 'Fizz' | |
{false, true} -> 'Buzz' | |
{false, false} -> nil | |
end | |
1..100 |> Enum.each fn(n) -> | |
case fizzbuzz.({rem(n, 3) == 0, rem(n, 5) == 0}) do | |
nil -> n | |
s -> s | |
end | |
|> IO.puts | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment