home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ozsi 10
/
Ozsi_10_1998_Tide_Side_A.d64
/
frac.tree..._rtn
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
1KB
|
50 lines
10 dima(4),b(4),c(4),d(4),e(4),f(4),p(4)
20 data 4
30 data 0,0,0,.50,0,0,.05
40 data .01,0,0,.10,0,.20,.15
50 data .42,-.42,.42,.42,0,.20,.40
60 data .42,.42,-.42,.42,0,.20,.40
70 read m
80 pt=0
90 for j=1 to m
100 read a(j),b(j),c(j),d(j),e(j),f(j),pk
110 pt=pt+pk
120 p(j)=pt
130 next j
140 gosub 500
150 xscale=370
160 yscale=265
170 xoffset=160
180 yoffset=50
190 x=0
200 y=0
210 n=0
220 pk=rnd(1)
230 if pk<=p(1) then k=1:goto 240
231 if pk<=p(2) then k=2:goto 240
232 if pk<=p(3) then k=3:goto 240
233 k=4
240 nx=a(k)*x+b(k)*y+e(k)
250 ny=c(k)*x+d(k)*y+f(k)
260 x=nx
270 y=ny
280 if n>10 then xx=x*xscale+xoffset:yy=200-(y*yscale+yoffset):gosub 600
290 get a$:ifa$<>"" then goto 310
300 n=n+1:goto 220
310 get a$:ifa$="" then goto 310
320 poke 53272,20:poke 53265,27:poke 53280,14:print chr$(147)
330 end
500 rem** set up the graphics screen **
510 poke 53265,peek(53265)or32
520 poke 53272,peek(53272)or8
530 bm=8192
540 for i=bm to bm+7999:poke i,0:next i
550 for i=1024 to 2023:poke i,13:next i
560 poke 53280,13
570 return
600 rem** plot a point on the screen **
610 by=bm+320*int(yy/8)+8*int(xx/8)+(yyand7)
620 bt=7-(xx and 7)
630 poke by,peek(by)or(2^bt)
640 return