07-26-2023, 05:30 PM
..and well known darkRed mandelbrot:
Code: (Select All)
'mandelbrot red-dark nuBasic => micro(A)
var start,endtime,time
var x0,y0,x,y,iteration,maxIteration,xtemp,d,dx,dy,c,xxyy
fcolor 0,0,0 : Rect 0,0,800,600 : swap
GETTICK start
x0 = -2
while x0 < 2
y0 = -1.5
while y0 < 1.5
x = 0
y = 0
iteration = 0
maxIteration = 223
label Doloop
xtemp = x*x-y*y+x0
y = 2*x*y+y0
x = xtemp
iteration = iteration + 1
xxyy = x*x+y*y
If iteration < maxIteration & xxyy < 4 : goto DoLoop: Endif
If iteration ! maxIteration : c = iteration :Else :c = 0: Endif
d=150 : dx=300 : dy=300
c=c*16 : fcolor c,0,0
Rect x0*d+dx, y0*d+dy, 2, 2
y0 = y0 + 0.013
wend
swap
x0 = x0 + 0.013
wend
GETTICK endtime
time = (endTime - start) / 1000
fcolor 200,200,240: print 10,10,time : swap
mode 1
micro(A)developer
http://basic4us.epizy.com/forum/index.php
http://basic4us.epizy.com/forum/index.php