Skip to content

Instantly share code, notes, and snippets.

@joffotron
Created April 5, 2016 00:30
Show Gist options
  • Save joffotron/3428103b7efef9c844e6f1b6dcc7dcfe to your computer and use it in GitHub Desktop.
Save joffotron/3428103b7efef9c844e6f1b6dcc7dcfe to your computer and use it in GitHub Desktop.
fizzbuzz = fn
0, 0, _ -> "FizzBuzz"
0, _, _ -> "Fizz"
_, 0, _ -> "Buzz"
_, _, c -> c
end
buzzy = fn n -> fizzbuzz.(rem(n,3), rem(n,5), n) end
Enum.each 10..16, fn i -> IO.puts buzzy.(i) end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment