aboutsummaryrefslogtreecommitdiff
path: root/nfib.icl
diff options
context:
space:
mode:
Diffstat (limited to 'nfib.icl')
-rw-r--r--nfib.icl11
1 files changed, 11 insertions, 0 deletions
diff --git a/nfib.icl b/nfib.icl
new file mode 100644
index 0000000..bf297d3
--- /dev/null
+++ b/nfib.icl
@@ -0,0 +1,11 @@
+module nfib
+
+import StdEnv
+
+nfib :: !Int -> Int
+nfib n
+ | n < 2
+ = 1
+ = nfib (n-2) + nfib (n-1) + 1
+
+Start = nfib 43