home *** CD-ROM | disk | FTP | other *** search
/ Ozsi 10 / Ozsi_10_1998_Tide_Side_A.d64 / frac.swirl.._rtn (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  1KB  |  51 lines

  1. 0 rem*swirl-fractual
  2. 10 dima(4),b(4),c(4),d(4),e(4),f(4),p(4)
  3. 20 data 3
  4. 30 data 0.79,-0.42,0.24,0.86,1.76,1.41,0.90
  5. 40 data -0.12,0.26,0.15,0.05,-6.72,1.38,0.05
  6. 50 data 0.18,-0.14,0.09,0.18,6.09,1.57,0.05
  7. 60 data .85,.04,-.04,.85,0,1.6,.85
  8. 70 read m
  9. 80 pt=0
  10. 90 for j=1 to m
  11. 100 read a(j),b(j),c(j),d(j),e(j),f(j),pk
  12. 110 pt=pt+pk
  13. 120 p(j)=pt
  14. 130 next j
  15. 140 gosub 500
  16. 150 xscale=15
  17. 160 yscale=12
  18. 170 xoffset=150
  19. 180 yoffset=30
  20. 190 x=0
  21. 200 y=0
  22. 210 n=0
  23. 220 pk=rnd(1)
  24. 230 if pk<=p(1) then k=1:goto 240
  25. 231 if pk<=p(2) then k=2:goto 240
  26. 232 if pk<=p(3) then k=3:goto 240
  27. 233 k=4
  28. 240 nx=a(k)*x+b(k)*y+e(k)
  29. 250 ny=c(k)*x+d(k)*y+f(k)
  30. 260 x=nx
  31. 270 y=ny
  32. 280 if n>10 then xx=x*xscale+xoffset:yy=y*yscale+yoffset:gosub 600
  33. 290 get a$:ifa$<>"" then goto 310
  34. 300 n=n+1:goto 220
  35. 310 get a$:ifa$="" then goto 310
  36. 320 poke 53272,20:poke 53265,27:poke 53280,14:print chr$(147)
  37. 330 end
  38. 500 rem** set up the graphics screen **
  39. 510 poke 53265,peek(53265)or32
  40. 520 poke 53272,peek(53272)or8
  41. 530 bm=8192
  42. 540 for i=bm to bm+7999:poke i,0:next i
  43. 550 for i=1024 to 2023:poke i,13:next i
  44. 560 poke 53280,13
  45. 570 return
  46. 600 rem** plot a point on the screen **
  47. 610 by=bm+320*int(yy/8)+8*int(xx/8)+(yyand7)
  48. 620 bt=7-(xx and 7)
  49. 630 poke by,peek(by)or(2^bt)
  50. 640 return
  51.