From 50db021d1bfbb4bd3771f6f201f3c5ed1127737d Mon Sep 17 00:00:00 2001 From: melissafalcao <32322512+melissafalcao@users.noreply.github.com> Date: Thu, 17 Oct 2019 20:15:39 -0300 Subject: [PATCH] Create alternative-fib.hs --- alternative-fib.hs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 alternative-fib.hs diff --git a/alternative-fib.hs b/alternative-fib.hs new file mode 100644 index 0000000..fd00a5d --- /dev/null +++ b/alternative-fib.hs @@ -0,0 +1,5 @@ +fib :: Int -> Int +fib x + | x == 1 = 1 + | x == 0 = 0 + | otherwise = fib (x-1) + fib (x-2)