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
    nums$ = right("  " + string(i), 3) + "|"
    for j = 1 to 12
        if i <= j then
            if j >= 1 then
                nums$ += left("    ", (4 - length(string(i * j))))
            end if
            nums$ += string(i * j)
        else
            nums$ += "    "
        end if
    next j
    print nums$
next i