## Posted By

Zufolek on 06/08/09

# GW-BASIC Fireworks

/ Published in: Other

`5 PRINT"Starting"10 T\$=TIME\$12 Z=RND(1):IF T\$=TIME\$ THEN 12 ELSE T\$=TIME\$:T=014 T=T+1:FOR N=0 TO 99:NEXT N:IF T\$=TIME\$ THEN 1420 PRINT"Using interpreter? (y/n)":II=021 Z\$=INKEY\$:IF Z\$="" THEN 2122 IF Z\$="n" OR Z\$="N" THEN T=T*2 ELSE IF Z\$="y" OR Z\$="Y" THEN II=1 ELSE IF Z\$=CHR\$(27) THEN 999 ELSE GOTO 2029 SCREEN 130 N=999:FR=.9^(1000/T):GR=50/T:PR=9/T:FD=335 DIM X(999),Y(999),C(999),XX(999),YY(999),F(999),R(999),G(999),SI(127),CO(127)40 FOR Z=0 TO N:F(Z)=1:NEXT Z50 K=3.14159265#/6460 FOR Z=0 TO 12765 SI(Z)=SIN(Z*K)*12000/T:CO(Z)=COS(Z*K)*10000/T69 NEXT Z99 CLS:GOTO 205100 FOR Z=0 TO N105 IF F(Z)>0 THEN 190110 PSET(X(Z),Y(Z)),0120 X(Z)=X(Z)+XX(Z):Y(Z)=Y(Z)+YY(Z)125 IF R(Z)<0 OR X(Z)<0 OR X(Z)>=320 OR Y(Z)<0 OR Y(Z)>=200 THEN F(Z)=1:GOTO 190130 XX(Z)=XX(Z)*FR:YY(Z)=YY(Z)*FR+G(Z):R(Z)=R(Z)-1140 PSET(X(Z),Y(Z)),C(Z)190 NEXT Z200 IF RND(1)>PR THEN 900205 FX=RND(1)*320:FY=RND(1)*200:FC=1+INT(RND(1)*3)206 PR=PR+.001:DI=FD+RND(1)*3:FS=300/DI208 FQ=450-DI*60:GOSUB 5000210 X=0:FOR Z=0 TO FS220 IF F(X)=0 THEN X=X+1:IF X<=N THEN 220 ELSE GOTO 800240 X(X)=FX:Y(X)=FY:C(X)=FC250 R(X)=INT(RND(1)*T*.03)255 RD=INT(RND(1)*128):RS=RND(1)260 XX(X)=SI(RD)*RS/DI:YY(X)=CO(RD)*RS/DI:F(X)=0:G(X)=GR/DI290 X=X+1:IF X<=N THEN NEXT Z800 IF FD>.2 THEN FD=FD-.1900 IF INKEY\$="" THEN 100990 IF II>0 THEN SCREEN 0999 PRINT"Fireworks":PRINT"2007-9 Zufolek":END5000 SOUND FQ,15005 SOUND FQ*.5,15099 RETURN`