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.




 
PROGRAM "multiplicationtables"
VERSION "0.0001"
 
DECLARE FUNCTION Entry()
 
FUNCTION Entry()
  $N = 12
  FOR j@@ = 1 TO $N - 1
    PRINT FORMAT$("### ", j@@);
  NEXT j@@
  PRINT FORMAT$("###", $N)
  FOR j@@ = 0 TO $N - 1
    PRINT "----";
  NEXT j@@
  PRINT "+"
  FOR i@@ = 1 TO $N
    FOR j@@ = 1 TO $N
      IF j@@ < i@@ THEN
        PRINT "    ";
      ELSE
        PRINT FORMAT$("### ", i@@ * j@@);
      END IF
    NEXT j@@
    PRINT "|"; FORMAT$(" ##", i@@)
  NEXT i@@
END FUNCTION
END PROGRAM
 