cwtests/cw05/sqr.fun
author Christian Urban <christian.urban@kcl.ac.uk>
Thu, 19 Sep 2024 19:21:52 +0100
changeset 963 85bb0ef99fc7
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)