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.




mulTable: function [n][
    print ["    |"] ++ map 1..n => [pad to :string & 3]
    print "----+" ++ join map 1..n => "----"
    loop 1..n 'x [
        prints (pad to :string x 3) ++ " |"
        if x>1 -> loop 1..x-1 'y [prints "    "]
        loop x..n 'y [prints " " ++ pad to :string x*y 3]
        print ""
    ]
]
 
mulTable 12