Mandelbrot fractal on QL
Posted: Sun Oct 20, 2013 8:49 pm
I was just playing with QL and SBasic, but the result, I think, looks nice.
RIP Sir Clive Sinclair 1940 - 2021
https://theqlforum.com/
Code: Select all
10 sizex%=366:sizey%=256
20 maxiter%=256
30 MODE 8:WINDOW #1,sizey%*2,sizey%,0,0
40 SCALE sizey%,0,0
45 a%=10
50 FOR x%=0 TO sizex%
60 xi=x%/a%-2
70 FOR y%=0 TO sizey%/2
80 yi=y%/a%
90 x=0:y=0
100 FOR i%=1 TO maxiter%
110 IF x*x+y*y>4 THEN EXIT i%
120 xt=xi+x*x-y*y
130 y=yi+2*x*y
140 x=xt
150 END FOR i%
160 IF i%>maxiter% THEN LET i%=0
170 INK i% MOD 256: POINT x%,y%+sizey%/2,x%,sizey%/2-y%
180 NEXT y%
190 NEXT x%
195 SBYTES "flp1_"&(a%/10),$20000,$8000
200 a%=a%+10:GO TO 50
Code: Select all
50 max%=86
60 FOR a%=1 TO max%
70 AT 10,15:PRINT a%
80 COPY "flp1_"&a% TO "ram1_"&a%
90 NEXT a%
------------ this copied files to RAMdisk
100 max%=86
110 FOR a%=1 TO max%
120 LBYTES "ram1_"&a%,$20000
130 PAUSE 5 : REMark alter to change speed
140 NEXT a%
150 GO TO 110