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

17 lines
399 B
Text

input "Number of rows needed:- "; rowsNeeded
dim colWidth(rowsNeeded) ' 5 rows implies 5 columns
for col=1 to rowsNeeded
colWidth(col) = len(str$(col + rowsNeeded*(rowsNeeded-1)/2))
next
currentNumber =1
for row=1 to rowsNeeded
for col=1 to row
print right$( " "+str$( currentNumber), colWidth(col)); " ";
currentNumber = currentNumber + 1
next
print
next