RosettaCodeData/Task/Catalan-numbers-Pascals-triangle/Run-BASIC/catalan-numbers-pascals-triangle.basic
2023-07-01 13:44:08 -04:00

9 lines
206 B
Text

n = 15
dim t(n+2)
t(1) = 1
for i = 1 to n
for j = i to 1 step -1 : t(j) = t(j) + t(j-1): next j
t(i+1) = t(i)
for j = i+1 to 1 step -1: t(j) = t(j) + t(j-1 : next j
print t(i+1) - t(i);" ";
next i