9e03717deb
FossilOrigin-Name: 088675e452ed86a712563c8b2597fe4d47da59bdea0e40becdd1e028a84c47b0
13 lines
168 B
Forth
13 lines
168 B
Forth
# example|RecursiveFactorial
|
|
|
|
~~~
|
|
:<factorial>
|
|
dup #1 -eq? 0; drop
|
|
dup n:dec <factorial> * ;
|
|
|
|
:factorial
|
|
dup n:zero?
|
|
[ n:inc ]
|
|
[ <factorial> ] choose ;
|
|
~~~
|
|
|