progs/fact.fun
changeset 626 2d91b2107656
parent 224 70198792c2aa
child 655 3d04ee04966d
equal deleted inserted replaced
625:6709fa87410b 626:2d91b2107656
       
     1 def fact(n) = if n == 0 then 1 else n * fact(n - 1);
       
     2 
       
     3 def facT(n, acc) = if n == 0 then acc else facT(n - 1, n * acc);
       
     4 
       
     5 facT(15, 1)
       
     6 
       
     7 //fact(15)
       
     8