Created
May 7, 2014 12:56
-
-
Save alco/4807a17bf30802d83642 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 Fib do | |
| def fib(0), do: 0 | |
| def fib(1), do: 1 | |
| def fib(n), do: fib(n-1) + fib(n-2) | |
| end | |
| IO.puts Fib.fib(20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment