16 lines
271 B
Text
16 lines
271 B
Text
FloydsTriangle[rows] :=
|
|
{
|
|
result = new array
|
|
n = 1
|
|
for r = 1 to rows
|
|
{
|
|
result.push[array[n to n+r-1]]
|
|
n = n + r
|
|
}
|
|
|
|
return result
|
|
}
|
|
|
|
println[formatTable[FloydsTriangle[5], "right"]]
|
|
println[]
|
|
println[formatTable[FloydsTriangle[14], "right"]]
|