From a9d6c221d7686e3055593359b02125a3f20ab3e5 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Sat, 20 Jan 2024 02:38:26 -0800 Subject: add map, filter might work? --- stemlib/fib.stem | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 stemlib/fib.stem (limited to 'stemlib/fib.stem') 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 -- cgit