Created
June 16, 2015 13:54
-
-
Save Clokze/fdf37387536a519b7260 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 Math do | |
| def fibonnaci(n, prev \\ 0, current \\ 1) | |
| def fibonnaci(n, _prev, current) when n < 1 do | |
| IO.puts(current) | |
| end | |
| def fibonnaci(n, prev, current) do | |
| fibonnaci(n - 1, current, current + prev) | |
| end | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment