cwtests/cw05/sqr.fun
author Christian Urban <christian.urban@kcl.ac.uk>
Wed, 21 Feb 2024 09:14:12 +0000
changeset 959 64ec1884d860
parent 856 23273e3a120f
permissions -rw-r--r--
updated and added pascal.while file

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)