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.


 
function Floyd(sys n) as string
sys i,t
for i=1 to n
  t+=i
next
string s=str t
sys le=1+len s
string cr=chr(13,10)
sys lc=len cr
string buf=space(le*t+n*lc)
sys j,o,p=1
t=0
for i=1 to n
  for j=1 to i
    t++
    s=str t
    o=le-len(s)-1 'right justify
    mid buf,p+o,str t
    p+=le
  next
  mid buf,p,cr
  p+=lc
next
return left buf,p-1
end function
 
putfile "s.txt",Floyd(5)+floyd(14)
 