progs/fact.rec
author Christian Urban <urbanc@in.tum.de>
Sun, 23 Sep 2018 09:04:24 +0100
changeset 557 9ab8a6fc58c0
parent 224 70198792c2aa
permissions -rw-r--r--
merged

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)