Created
March 25, 2016 02:31
-
-
Save joeljackson/6d3877d6c12efa4009ee to your computer and use it in GitHub Desktop.
Fibonnacci 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 Fib do | |
| def fib(0), do: 0 | |
| def fib(1), do: 1 | |
| def fib(n), do: fib(n-1) + fib(n-2) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment