RosettaCodeData/Task/Floyds-triangle/Yabasic/floyds-triangle.basic

21 lines
462 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
sub FloydTriangle (fila)
dim numColum(fila)
for colum = 1 to fila
numColum(colum) = len(str$(colum + fila * (fila - 1) / 2))
next colum
print "output for ", str$(fila), "\n"
thisNum = 1
for r = 1 to fila
for colum = 1 to r
print right$(" " + str$(thisNum), numColum(colum)), " ";
thisNum = thisNum + 1
next colum
print
next
end sub
FloydTriangle (5)
print
FloydTriangle (14)