progs/fun2/sqr.fun
author Christian Urban <christian.urban@kcl.ac.uk>
Sat, 19 Dec 2020 00:13:58 +0000
changeset 820 7fd1f611c21d
child 854 ce4a7bab6bd8
permissions -rw-r--r--
updated

val Max : Int = 10;

def sqr(x: Int) : Int = x * x;

def all(n: Int) : Void = {
  if n <= Max
  then print_int(sqr(n)) ; all(n + 1)
  else skip()
};

all(0)