RosettaCodeData/Task/Floyds-triangle/Yabasic/floyds-triangle.basic
2023-07-01 13:44:08 -04:00

20 lines
462 B
Text

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)