Created
September 7, 2015 21:41
-
-
Save rbarbey/0c5d3fe6ddd4069f5e12 to your computer and use it in GitHub Desktop.
My first (rather academic) program in Elixir
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 Fibonacci do | |
def number(0) do | |
1 | |
end | |
def number(1) do | |
1 | |
end | |
def number(n) do | |
number(n-1) + number(n-2) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment