summaryrefslogtreecommitdiff
path: root/examples/fib.marp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/fib.marp')
-rw-r--r--examples/fib.marp16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/fib.marp b/examples/fib.marp
new file mode 100644
index 0000000..c29476d
--- /dev/null
+++ b/examples/fib.marp
@@ -0,0 +1,16 @@
+# Print out given number of elements in the Fibonacci sequence, 46 is the max value
+define fib
+ var lim !lim
+ var a 1 !a
+ var b 1 !b
+ @lim while dup 0 > do
+ @a dump
+ @b dup
+ @a
+ + !b
+ !a
+ 1 -
+ done
+end
+
+10 fib