aboutsummaryrefslogtreecommitdiff
path: root/examples/fib.stem
blob: 4104a361c60203efbfed9bbe65fcfe2f3b55783c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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