diff options
Diffstat (limited to 'stemlib/fib.stem')
-rw-r--r-- | stemlib/fib.stem | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/stemlib/fib.stem b/stemlib/fib.stem new file mode 100644 index 0000000..de02b5c --- /dev/null +++ b/stemlib/fib.stem @@ -0,0 +1,20 @@ +# Author: Andrei Sova 2023 +fib [ + dup 1 <= [ ] [ + dup 1 - fib + swap + dup 2 - fib + swap + dsc + + + ] if +] func + +main [ + dup 10 <= [ + dup fib . + 1 + main + ] [ exit ] if +] func + +0 main |