From 33f28950a03f245d7e4d2f06b931fdf71c274120 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 30 Jan 2023 22:33:15 +0100 Subject: [PATCH] Fibonacci example. --- examples/fib.aocla | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 examples/fib.aocla diff --git a/examples/fib.aocla b/examples/fib.aocla new file mode 100644 index 0000000..4f01fa8 --- /dev/null +++ b/examples/fib.aocla @@ -0,0 +1,16 @@ +// Fibonacci example + +[(n) + [$n 1 <=] + [ + $n + ] + [ + $n 1 - fib + $n 2 - fib + + + ] ifelse +] 'fib def + +10 fib +printnl