RosettaCodeData/Task/Factorial/Klingphix/factorial.klingphix
2023-07-01 13:44:08 -04:00

18 lines
236 B
Text

{ recursive }
:factorial
dup 1 great (
[dup 1 - factorial *]
[drop 1]
) if
;
{ iterative }
:factorial2
1 swap [*] for
;
( 0 22 ) [
"Factorial(" print dup print ") = " print factorial2 print nl
] for
" " input