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.




    nmax=12, xx=3
    s= blanks(xx)+" |"
    for j=1:nmax
        s=s+part(blanks(xx)+string(j),$-xx:$)
    end
    printf("%s\n",s)
    s=strncpy("-----",xx)+" +"
    for j=1:nmax
        s=s+" "+strncpy("-----",xx)
    end
    printf("%s\n",s)
    for i=1:nmax
        s=part(blanks(xx)+string(i),$-xx+1:$)+" |"
        for j = 1:nmax
            if j >= i then 
                s=s+part(blanks(xx)+string(i*j),$-xx:$) 
            else 
                s=s+blanks(xx+1)
	    end
        end
        printf("%s\n",s)
    end