Floyd's triangle   lists the natural numbers in a right triangle aligned to the left where

 the first row is   1     (unity)
 successive rows start towards the left with the next number followed by successive naturals listing one more number than the line above.


The first few lines of a Floyd triangle looks like this:

 1
 2  3
 4  5  6
 7  8  9 10
11 12 13 14 15



Task

 Write a program to generate and display here the first   n   lines of a Floyd triangle. 
(Use   n=5   and   n=14   rows).
 Ensure that when displayed in a mono-space font, the numbers line up in vertical columns as shown and that only one space separates numbers of the last row.


Procedure.i sumTo(n) 
  Protected r,i
  For i=1 To n 
    r+i
  Next 
  ProcedureReturn r.i
EndProcedure
 
; [1]
; array rsA(n)... string-lengths of the numbers
; in the bottom row
 
; [2]
; sumTo(i-1)+1    to     sumTo(i)
           ; 11 12 13 14 15
  ; here k is the column-index for array rsA(k)
 
Procedure.s FloydsTriangle(n)
  Protected r.s,s.s,t.s,i,j,k
  ; [1]
  Dim rsA(n)
  i=0
  For j=sumTo(n-1)+1 To sumTo(n)
    i+1
    rsA(i)=Len(Str(j))
  Next
  ; [2]
  For i=1 To n 
    t.s="":k=0
    For j=sumTo(i-1)+1 To sumTo(i)
      k+1:t.s+RSet(Str(j),rsA(k)," ")+" "
    Next 
    r.s+RTrim(t.s)+Chr(13)+Chr(10)
  Next 
  r.s=Left(r.s,Len(r.s)-2)
  ProcedureReturn r.s
EndProcedure
 
If OpenConsole() 
  n=5
  r.s=FloydsTriangle(n)
  PrintN(r.s)
 
  n=14
  r.s=FloydsTriangle(n)
  PrintN(r.s)
 
  Print(#crlf$ + #crlf$ + "Press ENTER to exit"): Input()
  CloseConsole()
EndIf