next up previous contents index
Next: The snowflake (with thanks Up: Program examples Previous: Draw a whole rectangle   Contents   Index


Factorial

Reminder: $ 5!=5\times4\times3\times2\times1=120$
to fac :n
if :n=1[output 1][output :n*fac :n-1]
end

por fac 5
120.0
pr fac 6
720.0



Loïc 2008-06-08