aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-01-05 18:26:26 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2025-01-05 18:26:26 +0200
commit79d80d2d8905b62a30f8856b86811ed932c00c45 (patch)
tree4450dd14740a2d7e94e354e4e9fd5d4a7041de15 /examples
parent1b670d703473fbf00cb6e1a8411e0e8c27e84c8e (diff)
downloadposthaste-79d80d2d8905b62a30f8856b86811ed932c00c45.tar.gz
posthaste-79d80d2d8905b62a30f8856b86811ed932c00c45.zip
fix procedure/function compilation
+ Add fib example
Diffstat (limited to 'examples')
-rw-r--r--examples/fib.ph11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/fib.ph b/examples/fib.ph
new file mode 100644
index 0000000..9e1a185
--- /dev/null
+++ b/examples/fib.ph
@@ -0,0 +1,11 @@
+function Fib{ num[int] } return int
+is
+ do
+ 1
+ unless 1 < num
+ otherwise
+ Fib(num - 1) + Fib(num - 2)
+ done
+end function
+
+print Fib(42)