#simple test to check if recursion works.  should return 720

module main;

const n:int = 6;

procedure factorial(x: int) : int;
  begin
    if x <= 1 then
      return 1;
    else
      return x*factorial(x-1);
    end;
  end factorial;

begin
  output := factorial(6);

end main.