retroforth/example/RecursiveFibonacci.forth
crc e549b4ced6 no longer use ```` for code blocks; this fence sequence will be used for embedded tests in a later update
FossilOrigin-Name: dfed0de00b8d63672a882b79c4951cce0076007ef208c063b2f4e54fe9bd08f8
2018-04-25 16:57:28 +00:00

10 lines
144 B
Forth

# example|RecursiveFibonacci
~~~
:fib (n-m)
dup
[ n:zero? ] [ #1 eq? ] bi or
not 0; drop
[ n:dec fib ] sip
[ #2 - fib ] call + ;
~~~