cwtests/cw05/sqr.fun
author Christian Urban <christian.urban@kcl.ac.uk>
Sun, 10 Sep 2023 12:24:55 +0100
changeset 917 89e05a230d2d
parent 856 23273e3a120f
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)) ; new_line(); all(n + 1) }
  else skip()
};

all(0)