diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/fib.stem | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/fib.stem b/examples/fib.stem new file mode 100644 index 0000000..4104a36 --- /dev/null +++ b/examples/fib.stem @@ -0,0 +1,19 @@ +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 |