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.




PRINT "  X|   1   2   3   4   5   6   7   8   9  10  11  12"
PRINT "---+------------------------------------------------"
 
FOR i = 1 TO 12
    LET nums$ = ("  " & STR$(i))[LEN("  " & STR$(i))-3+1:maxnum] & "|"
    FOR j = 1 TO 12
        IF i <= j THEN
           IF j >= 1 THEN LET nums$ = nums$ & ("    ")[1:(4-LEN(STR$(i*j)))]
           LET nums$ = nums$ & STR$(i*j)
        ELSE
           LET nums$ = nums$ & "    "
        END IF
    NEXT j
    PRINT nums$
NEXT i
PRINT
END