Skip to content

Instantly share code, notes, and snippets.

@rbarbey
Created September 7, 2015 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbarbey/0c5d3fe6ddd4069f5e12 to your computer and use it in GitHub Desktop.
Save rbarbey/0c5d3fe6ddd4069f5e12 to your computer and use it in GitHub Desktop.
My first (rather academic) program in Elixir
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