I suggest using an array with as many elements as the longest row you need. To keep it simple, keep two copies of the array, and calculate each element of the "new" array as the sum of the corresponding element, plus the previous element, of the "old" array. Then copy the information back for the next step.
10 SCREEN 2 20 PSET (200,120) 30 DRAW "E100 F100 L200" 40 PSET (200,50) 50 DRAW "R200 G100 H100" END
10 cls 20 end 30 next 40 print
fd 60 rt 120 fd 60 rt 120 fd 60 rt 120 will cause the turtle to draw a triangle. The square brackets indicate that the enclosed commands are to be executed three times, repeat 3 [fd 60 rt 120] Search Google with: "logo commands triangle" and have a look through the websites on the subject.
Pascals
The GWBASIC comma operator is used to format the output of the PRINT command, placing the value to be printed in the next print zone rather than immediately after the previous value. Note that GWBASIC divides each line into zones of 14 spaces each. The comma operator also has other purposes, such as when filling a string with the same character. For example: 10 X$ = STRING$(10,45) 20 PRINT X$"HELLO WORLD"X$ RUN ----------HELLO WORLD---------- The comma operator is also used to separate the dimensions of a multi-dimensional array, such as the following 2x3 array: A(2,3)
Pascal's triangle
pascal
The Sierpinski Triangle
pascals triangle is used to solve math problems that have chance of 2 different outcomes, such as flipping a coin
Pascal didn't invent pascals triangle, he just made It popular. A Chinese mathematician invented it in about 1015.
in the 11th century...
35
1,4,6,4,1
(a+b)7
Blaise Pascal.
The expanded binomial is another name for Pascal's triangle.
depends. If you start Pascals triangle with (1) or (1,1). The fifth row with then either be (1,4,6,4,1) or (1,5,10,10,5,1). The sums of which are respectively 16 and 32.