Hi,
another mandelbrot.
include "asm.inc"
window 600,500,1
sys ma=16
single xs=-2.5,ys=-2,zml=1.25
Function cfunc(sys p,w) as sys
pP=(p*1792)/w
sys red,green,blue
if pP <256
red=0
green=0
blue=pP
else if pP <512
red=0
green=pP-256
blue=255
else if pP <768
red=0
green=255
blue =255-(pP-512)
else if pP <1024
red= pP-768
green=255
blue=0
else if pP <1280
red=255
green=255-(pP-1024)
blue=0
else if pP <1536
red=255
green=0
blue=pP-1280
else
red=255
green=pP-1536
blue=255
end if
Return RGB(red,green+4,blue)
End Function
Sub funcpix(sys ix,iy, single x,y,zm)
single xC=(xs)+(single(ix)+.5)/100/zm)
single yC=(ys)+(single(iy)-.5)/100/zm)
single x0=(xs)+(single(ix)+.5)/100/zm)
single y0=(ys)+(single(iy)-.5)/100/zm)
single x2=xc*xc
single y2=yc*yc
sys it
while (x2+y2) < (2*2) and it < ma
yc = 2*xc*yc + y0
xc = x2 - y2 + x0
x2 = xc*xc
y2 = yc*yc
it +=1
wend
if it=ma
PutPixel ix,iy,rgb(41,60,194)
else
PutPixel ix,iy,cfunc(it,ma)
end if
End Sub
t = ticks
For i=0 to 600
For j=0 to 500
funcpix(i,j,xs,ys,zml)
Next
Next
color 255,255,255
text 0,0,12,"TIME: " + (ticks()-t)/1000 + " SECONDS"
WaitKey
WinExit
[attachment deleted by admin]