progs/fun/fa0.fun
author Christian Urban <christian.urban@kcl.ac.uk>
Tue, 31 Oct 2023 12:52:36 +0000
changeset 952 33b3e790e1d4
parent 903 2f86ebda3629
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
655
3d04ee04966d updated
Christian Urban <urbanc@in.tum.de>
parents: 626
diff changeset
     1
def fact(n) =
735
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 702
diff changeset
     2
  (if n == 0 then 1 else n * fact(n - 1));
224
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
655
3d04ee04966d updated
Christian Urban <urbanc@in.tum.de>
parents: 626
diff changeset
     4
903
2f86ebda3629 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 814
diff changeset
     5
write(fact(6))