~statianzo/sevenlangs

9127ef127308c3562baebc277dda2b7e942cacd8 — Jason Staten 1 year, 10 months ago 864aab2
fib
2 files changed, 10 insertions(+), 0 deletions(-)

M .gitignore
A erlang/fib.erl
M .gitignore => .gitignore +1 -0
@@ 2,3 2,4 @@
.bloop/
target/
project/metals.sbt
*.beam

A erlang/fib.erl => erlang/fib.erl +9 -0
@@ 0,0 1,9 @@
-module(fib).
-export([fibr/1]).


fibr(N) -> fibloop(N, 1, 1).

fibloop(0, A, _) -> A;
fibloop(1, _, B) -> B;
fibloop(N, A, B) -> fibloop(N-1, B, A+B).
\ No newline at end of file