cwtests/cw05/sqr.fun
author Christian Urban <christian.urban@kcl.ac.uk>
Sat, 09 Sep 2023 14:14:31 +0100
changeset 916 10f834eb0a9e
parent 856 23273e3a120f
permissions -rw-r--r--
texupdate

val Max : Int = 10;

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

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

all(0)