Skip to content

Instantly share code, notes, and snippets.

View andrecp's full-sized avatar
🏠
Working from home

André andrecp

🏠
Working from home
View GitHub Profile
@andrecp
andrecp / fizzbuzz.exs
Created June 16, 2017 05:16
FizzBuz in Elixir
fizzbuzz = fn
0, 0, c -> "FizzBuzz"
0, b, c -> "Fizz"
a, 0, c -> "Buzz"
a, b, c -> c
end
remainder = fn
n -> fizzbuzz.(rem(n, 3), rem(n, 5), n)
end