Skip to content

Instantly share code, notes, and snippets.

View rrshaban's full-sized avatar

Razi rrshaban

View GitHub Profile
@rrshaban
rrshaban / FizzBuzz.exs
Last active January 12, 2016 16:40
FizzBuzz in Elixir
fb_helper = fn
(0, 0, _) -> "FizzBuzz"
(0, _, _) -> "Fizz"
(_, 0, _) -> "Buzz"
(_, _, x) -> x
end
fizz_buzz = fn
n -> fb_helper.(rem(n, 3), rem(n, 5), n)
end