progs/fun/add.fun
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 29 Nov 2024 18:59:32 +0000
changeset 976 e9eac62928f5
parent 814 1fbaa5f05516
permissions -rw-r--r--
updated



def add(x, y) =
  if x == 0 then y else 1 + (add(x - 1, y));

def addT(x, y) =
  if x == 0 then y else addT(x - 1, y + 1);

(write(add(1000, 1000)); addT(100000,100000))