Created
December 11, 2015 08:32
-
-
Save hmans/e1627b43629a646b8fd9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
defmodule FizzerBuzzer do | |
def go do | |
go(1) | |
end | |
def go(num) when num == 101 do | |
end | |
def go(num) do | |
cond do | |
rem(num, 15) == 0 -> | |
IO.puts "FizzBuzz" | |
rem(num, 3) == 0 -> | |
IO.puts "Fizz" | |
rem(num, 5) == 0 -> | |
IO.puts "Buzz" | |
true -> | |
IO.puts num | |
end | |
go(num + 1) | |
end | |
end | |
FizzerBuzzer.go |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment