Task

Produce a formatted   12×12   multiplication table of the kind memorized by rote when in primary (or elementary) school.



Only print the top half triangle of products.




$ include "seed7_05.s7i";
 
const proc: main is func
  local
    const integer: n is 12;
    var integer: i is 0;
    var integer: j is 0;
  begin
    for j range 1 to n do
      write(j lpad 3 <& " ");
    end for;
    writeln;
    writeln("-" mult 4 * n);
    for i range 1 to n do
      for j range 1 to n do
        if j < i then
          write("    ");
        else
          write(i * j lpad 3 <& " ");
        end if;
      end for;
      writeln("|" <& i lpad 3);
    end for;
  end func;