RosettaCodeData/Task/Floyds-triangle/Liberty-BASIC/floyds-triangle.liberty
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07: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