REM pascals triangle
REM taken from text book the natur of modern mathematics
REM Karl J. Smith
REM 1973

REM code presented by Scott W Gates

SCREEN 9: REM init screen
PRINT " This program will generate the n lines of pascal's"
PRINT " triangle"
PRINT " what is (n)"
INPUT n
20 LET d = 2
22 LET p(1) = 1
24 LET p(2) = 1
26 PRINT
28 PRINT "pascal's triangle for n ="; n; " is "
29 PRINT
30 PRINT " 1"
31 FOR i = 1 TO n
32 FOR j = 1 TO d
34 PRINT p(j);
35 NEXT j
36 LET d = d + 1
37 PRINT
38 FOR k = 2 TO d - 1
40 LET Q(k) = p(k) + p(k - 1)
41 NEXT k
42 LET p(d) = 1
44 FOR l = 2 TO d - 1
46 LET p(l) = q1(l)
47 NEXT l
50 NEXT i
100 END

