23 lines
538 B
Plaintext
23 lines
538 B
Plaintext
SUB floydtriangle (fila)
|
|
DIM numcolum(0)
|
|
MAT REDIM numcolum(fila)
|
|
FOR colum = 1 TO fila
|
|
LET numcolum(colum) = LEN(STR$(colum+fila*(fila-1)/2))
|
|
NEXT colum
|
|
PRINT "output for "; STR$(fila)
|
|
PRINT
|
|
LET thisnum = 1
|
|
FOR r = 1 TO fila
|
|
FOR colum = 1 TO r
|
|
PRINT (" " & STR$(thisnum))[LEN(" " & STR$(thisnum))-numcolum(colum)+1:maxnum]; " ";
|
|
LET thisnum = thisnum+1
|
|
NEXT colum
|
|
PRINT
|
|
NEXT r
|
|
END SUB
|
|
|
|
CALL FLOYDTRIANGLE (5)
|
|
PRINT
|
|
CALL FLOYDTRIANGLE (14)
|
|
END
|