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.




n = 12
func out h . .
  if h < 10
    write "  "
  elif h < 100
    write " "
  .
  write " "
  write h
.
write "     "
for i = 1 to n
  call out i
.
print ""
write "     "
for i = 1 to n
  write "----"
.
print ""
for i = 1 to n
  call out i
  write "|"
  for j = 1 to n
    if j < i
      write "    "
    else
      call out i * j
    .
  .
  print ""
.