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
For j = 1 To n - 1
  TextWindow.CursorLeft = (j - 1) * 4 + (3 - Text.GetLength(j))
  TextWindow.Write(j)
  TextWindow.Write(" ")
EndFor
TextWindow.CursorLeft = (n - 1) * 4 + (3 - Text.GetLength(n))
TextWindow.Write(n)
TextWindow.WriteLine("")
For j = 0 To n - 1
  TextWindow.Write("----")
EndFor
TextWindow.WriteLine("+")
For i = 1 To n
  For j = 1 To n 
    If j < i Then
      TextWindow.Write("    ")
    Else
      TextWindow.CursorLeft = (j - 1) * 4 + (3 - Text.GetLength(i * j))
      TextWindow.Write(i * j)
      TextWindow.Write(" ")
    EndIf
  EndFor
  TextWindow.Write("| ")
  TextWindow.CursorLeft = n * 4 + (4 - Text.GetLength(i))
  TextWindow.Write(i)
  TextWindow.WriteLine("")
EndFor
 