Created
February 10, 2017 00:20
-
-
Save olvap/1ec9a246b1c56025a1af279f08e7f344 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 Greeter do | |
def factorial(number) do | |
total = 1 | |
if number > 1 do | |
total = number * factorial(number - 1) | |
else | |
number | |
end | |
total | |
end | |
end | |
IO.puts Greeter.factorial(3) | |
I cant screen share. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment