2 PRINT TAB(24);"PASART" 4 PRINT TAB(18);"CREATIVE COMPUTING" 6 PRINT TAB(16);"MORRISTOWN NEW JERSEY" 8 PRINT:PRINT:PRINT 20 DIM P(36,36) 22 FOR B1=1 TO 36 24 FOR B2=1 TO 36 26 P(B1,B2)=0 28 NEXT B2 30 NEXT B1 40 PRINT "THIS PROGRAM CREATES ARTIST DESIGNS BASED ON PASCAL'S TRIAN"; 42 PRINT "GLE." 50 PRINT "YOU HAVE 3 BASIC TYPES OF DESIGNS TO SELECT FROM:" 60 PRINT "1. A SINGLE PASCAL'S TRIANGLE (PLAYED WITH AN ARTISTIC FLAR"; 63 PRINT "E)" 70 PRINT "2. TWO 'ARTSY' PASCAL'S TRIANGLES PRINTED BACK TO BACK" 80 PRINT "3. FOUR 'ARTSY' TRIANGLES IN THE CORNER OF" 90 PRINT " A SQUARE ARRAY." 100 PRINT "WHAT'S YOUR PLEASURE? 1, 2 OR 3"; 110 INPUT O 120 IF (O-1)*(O-2)*(O-3) <> 0 THEN 100 130 PRINT "WHICH MULTIPLES DO YOU WANT REPRESENTED WITH BLANKS"; 140 INPUT Q 150 PRINT "HOW MANY ROWS AND COLUMS IN THE ARRAY (36 IS MAXIMUM)"; 160 INPUT T 170 IF T*(36-T) < 0 THEN 150 180 ON O GOTO 230,440,690 190 REM 200 REM 210 REM TIME TO CREATE AND PRINT A SINGLE PIECE OF PASART 220 REM FIRST BUILD THE PASCALS TRIANGLE 230 FOR R=1 TO T 240 FOR C=1 TO T 250 IF (R-1)*(C-1)=0 THEN 280 260 P(R,C)=P(R,C-1)+P(R-1,C) 270 GOTO 290 280 P(R,C)=1 290 NEXT C 300 NEXT R 310 REM TIME TO PLAY BACK THE TRIANGLE WITH AN ARTISTIC FLARE. 320 FOR R=1 TO T 330 FOR C=1 TO T 340 IF P(R,C)=0 THEN 380 350 IF (P(R,C)/Q)=INT(P(R,C)/Q) THEN 380 360 PRINT "* "; 370 GOTO 390 380 PRINT " "; 390 NEXT C 400 PRINT 410 NEXT R 420 END 430 REM TIME TO CREATE AND PRINT DOUBLE PIECE OF PASART 440 Z=T 450 REM BUILD THE UPPER LEFT HAND HALF OF THE ARRAY. 460 LET N=Z 470 FOR R=1 TO N 480 FOR C=1 TO Z-1 490 IF (R-1)*(C-1)=0 THEN 520 500 P(R,C)=P(R,C-1)+P(R-1,C) 510 GOTO 530 520 P(R,C)=1 530 NEXT C 540 Z=Z-1 550 NEXT R 560 REM BUILD THE LOWER RIGHT HALF OF THE ARRAY. 570 Z=N 580 N=2 590 FOR R=Z TO 1 STEP -1 600 FOR C=Z TO N STEP -1 610 IF (R-Z)*(C-Z)=0 THEN 640 620 P(R,C)=P(R,C+1)+P(R+1,C) 630 GOTO 650 640 P(R,C)=1 650 NEXT C 660 N=N+1 670 NEXT R 680 GOTO 320 690 M=Q 700 REM BUILD THE UPPER LEFT HALF CORNER OF THE ARRAY. 710 Y=T 720 Z=INT(Y/2) 730 B5=Z*2 740 Z1=Z 750 Z2=Z1 760 Z3=Z2 770 X4=Z3 780 X5=X4 790 FOR I=1 TO Z1 800 FOR J=1 TO Z 810 IF (J-1)*(I-1)=0 THEN 840 820 P(I,J)=P(I,J-1)+P(I-1,J) 830 GOTO 850 840 P(I,J)=1 850 NEXT J 860 Z=Z-1 870 NEXT I 880 N=Z1 890 REM BUILD THE UPPER RIGHT HAND CORNER OF THE ARRAY. 900 FOR I=1 TO Z1 910 FOR J=Y TO X5+1 STEP -1 920 IF I=1 THEN 960 930 IF J=Y THEN 960 940 P(I,J)=P(I,J+1)+P(I-1,J) 950 GOTO 970 960 P(I,J)=1 970 NEXT J 980 X5=X5+1 990 NEXT I 1000 N=Z2 1010 REM BUILD THE LOWER LEFT CORNER OF THE ARRAY 1020 FOR I=Y TO X4+1 STEP -1 1030 FOR J=1 TO Z2 1040 IF J=1 THEN 1080 1050 IF I=Y THEN 1080 1060 P(I,J)=P(I,J-1)+P(I+1,J) 1070 GOTO 1090 1080 P(I,J)=1 1090 NEXT J 1100 Z2=Z2-1 1110 NEXT I 1120 N=Z3 1130 REM BUILD THE LOWER RIGHT CORNER OF THE ARRAY. 1140 FOR I=Y TO N+1 STEP -1 1150 FOR J=Y TO Z3+1 STEP -1 1160 IF J=Y THEN 1200 1170 IF I=Y THEN 1200 1180 P(I,J)=P(I+1,J)+P(I,J+1) 1190 GOTO 1210 1200 P(I,J)=1 1210 NEXT J 1220 Z3=Z3+1 1230 NEXT I 1240 GOTO 320 1250 END