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

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