progs/fact.rec
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Thu, 01 Oct 2015 23:09:20 +0100
changeset 338 f16120cb4e19
parent 224 70198792c2aa
permissions -rw-r--r--
updated

def fact(n) = if n == 0 then 1 else n * fact(n - 1);

def facT(n, acc) = if n == 0 then acc else facT(n - 1, n * acc);

facT(15, 1)

//fact(15)