GW-BASIC Fireworks


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. 5 PRINT"Starting"
  2. 10 T$=TIME$
  3. 12 Z=RND(1):IF T$=TIME$ THEN 12 ELSE T$=TIME$:T=0
  4. 14 T=T+1:FOR N=0 TO 99:NEXT N:IF T$=TIME$ THEN 14
  5. 20 PRINT"Using interpreter? (y/n)":II=0
  6. 21 Z$=INKEY$:IF Z$="" THEN 21
  7. 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
  8. 29 SCREEN 1
  9. 30 N=999:FR=.9^(1000/T):GR=50/T:PR=9/T:FD=3
  10. 35 DIM X(999),Y(999),C(999),XX(999),YY(999),F(999),R(999),G(999),SI(127),CO(127)
  11. 40 FOR Z=0 TO N:F(Z)=1:NEXT Z
  12. 50 K=3.14159265#/64
  13. 60 FOR Z=0 TO 127
  14. 65 SI(Z)=SIN(Z*K)*12000/T:CO(Z)=COS(Z*K)*10000/T
  15. 69 NEXT Z
  16. 99 CLS:GOTO 205
  17. 100 FOR Z=0 TO N
  18. 105 IF F(Z)>0 THEN 190
  19. 110 PSET(X(Z),Y(Z)),0
  20. 120 X(Z)=X(Z)+XX(Z):Y(Z)=Y(Z)+YY(Z)
  21. 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
  22. 130 XX(Z)=XX(Z)*FR:YY(Z)=YY(Z)*FR+G(Z):R(Z)=R(Z)-1
  23. 140 PSET(X(Z),Y(Z)),C(Z)
  24. 190 NEXT Z
  25. 200 IF RND(1)>PR THEN 900
  26. 205 FX=RND(1)*320:FY=RND(1)*200:FC=1+INT(RND(1)*3)
  27. 206 PR=PR+.001:DI=FD+RND(1)*3:FS=300/DI
  28. 208 FQ=450-DI*60:GOSUB 5000
  29. 210 X=0:FOR Z=0 TO FS
  30. 220 IF F(X)=0 THEN X=X+1:IF X<=N THEN 220 ELSE GOTO 800
  31. 240 X(X)=FX:Y(X)=FY:C(X)=FC
  32. 250 R(X)=INT(RND(1)*T*.03)
  33. 255 RD=INT(RND(1)*128):RS=RND(1)
  34. 260 XX(X)=SI(RD)*RS/DI:YY(X)=CO(RD)*RS/DI:F(X)=0:G(X)=GR/DI
  35. 290 X=X+1:IF X<=N THEN NEXT Z
  36. 800 IF FD>.2 THEN FD=FD-.1
  37. 900 IF INKEY$="" THEN 100
  38. 990 IF II>0 THEN SCREEN 0
  39. 999 PRINT"Fireworks":PRINT"2007-9 Zufolek":END
  40. 5000 SOUND FQ,1
  41. 5005 SOUND FQ*.5,1
  42. 5099 RETURN

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.