Created
August 28, 2017 18:16
-
-
Save stevenwilkin/73f3cb572e7e65f9c487135d2e75afe4 to your computer and use it in GitHub Desktop.
Revisions
-
stevenwilkin created this gist
Aug 28, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ #!/usr/bin/env elixir defmodule FizzBuzz do def check(x) when (rem(x, 3) == 0) and (rem(x, 5) == 0) do IO.puts "FizzBuzz" end def check(x) when rem(x, 3) == 0 do IO.puts "Fizz" end def check(x) when rem(x, 5) == 0 do IO.puts "Buzz" end def check(x) do IO.puts x end def run do Enum.each(1 .. 100, &check/1) end end FizzBuzz.run