Return to Snippet

Revision: 14645
at June 8, 2009 16:35 by Zufolek


Updated Code
5 PRINT"Starting"
10 T$=TIME$
12 Z=RND(1):IF T$=TIME$ THEN 12 ELSE T$=TIME$:T=0
14 T=T+1:FOR N=0 TO 99:NEXT N:IF T$=TIME$ THEN 14
20 PRINT"Using interpreter? (y/n)":II=0
21 Z$=INKEY$:IF Z$="" THEN 21
22 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 20
29 SCREEN 1
30 N=999:FR=.9^(1000/T):GR=50/T:PR=9/T:FD=3
35 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 Z
50 K=3.14159265#/64
60 FOR Z=0 TO 127
65 SI(Z)=SIN(Z*K)*12000/T:CO(Z)=COS(Z*K)*10000/T
69 NEXT Z
99 CLS:GOTO 205
100 FOR Z=0 TO N
105 IF F(Z)>0 THEN 190
110 PSET(X(Z),Y(Z)),0
120 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 190
130 XX(Z)=XX(Z)*FR:YY(Z)=YY(Z)*FR+G(Z):R(Z)=R(Z)-1
140 PSET(X(Z),Y(Z)),C(Z)
190 NEXT Z
200 IF RND(1)>PR THEN 900
205 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/DI
208 FQ=450-DI*60:GOSUB 5000
210 X=0:FOR Z=0 TO FS
220 IF F(X)=0 THEN X=X+1:IF X<=N THEN 220 ELSE GOTO 800
240 X(X)=FX:Y(X)=FY:C(X)=FC
250 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/DI
290 X=X+1:IF X<=N THEN NEXT Z
800 IF FD>.2 THEN FD=FD-.1
900 IF INKEY$="" THEN 100
990 IF II>0 THEN SCREEN 0
999 PRINT"Fireworks":PRINT"2007-9 Zufolek":END
5000 SOUND FQ,1
5005 SOUND FQ*.5,1
5099 RETURN

Revision: 14644
at June 8, 2009 16:00 by Zufolek


Initial Code
5 PRINT"Starting"
10 T$=TIME$
12 Z=RND(1):IF T$=TIME$ THEN 12 ELSE T$=TIME$:T=0
14 T=T+1:FOR N=0 TO 99:NEXT N:IF T$=TIME$ THEN 14
20 PRINT"Using interpreter? (y/n)":II=0
21 Z$=INKEY$:IF Z$="" THEN 21
22 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 20
29 SCREEN 1
30 N=999:FR=.9^(1000/T):GR=50/T:PR=9/T:FD=3
35 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 Z
50 K=3.14159265#/64
60 FOR Z=0 TO 127
65 SI(Z)=SIN(Z*K)*12000/T:CO(Z)=COS(Z*K)*10000/T
69 NEXT Z
99 CLS:GOTO 205
100 FOR Z=0 TO N
105 IF F(Z)>0 THEN 190
110 PSET(X(Z),Y(Z)),0
120 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 190
130 XX(Z)=XX(Z)*FR:YY(Z)=YY(Z)*FR+G(Z):R(Z)=R(Z)-1
140 PSET(X(Z),Y(Z)),C(Z)
190 NEXT Z
200 IF RND(1)>PR THEN 900
205 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/DI
208 FQ=450-DI*60:GOSUB 5000
210 X=0:FOR Z=0 TO FS
220 IF F(X)=0 THEN X=X+1:IF X<=N THEN 220 ELSE GOTO 800
240 X(X)=FX:Y(X)=FY:C(X)=FC
250 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/DI
290 X=X+1:IF X<N THEN NEXT Z
800 IF FD>.2 THEN FD=FD-.1
900 IF INKEY$="" THEN 100
990 IF II>0 THEN SCREEN 0
999 PRINT"Fireworks":PRINT"2007-9 Zufolek":END
5000 SOUND FQ,1
5005 SOUND FQ*.5,1
5099 RETURN

Initial URL

                                

Initial Description

                                

Initial Title
GW-BASIC Fireworks

Initial Tags

                                

Initial Language
Other