mirror of
https://git.sr.ht/~crc_/retroforth
synced 2024-11-16 19:48:56 +01:00
848ba7303b
FossilOrigin-Name: b5feea667d30aac255d1cfca61fed355d438d2ce6021677f1e53af6302b15eee
13 lines
168 B
Text
13 lines
168 B
Text
# example|RecursiveFactorial
|
|
|
|
~~~
|
|
:<factorial>
|
|
dup #1 -eq? 0; drop
|
|
dup n:dec <factorial> * ;
|
|
|
|
:factorial
|
|
dup n:zero?
|
|
[ n:inc ]
|
|
[ <factorial> ] choose ;
|
|
~~~
|
|
|