aboutsummaryrefslogtreecommitdiff
path: root/nfib.icl
diff options
context:
space:
mode:
authorCamil Staps2021-01-07 18:55:06 +0100
committerCamil Staps2021-01-07 18:55:17 +0100
commit45aa0a9eaf7119b219e190f5a0d09ddd8bc6c598 (patch)
treed83300bda7e9cbc6df5a358dabac9d45a76072bd /nfib.icl
parentInitial commit: fib (eqI_b and ltI version); nfib (diff)
Centralize instruction implementations
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