55 lines
987 B
Text
55 lines
987 B
Text
nomainwin
|
|
|
|
WindowWidth =440
|
|
WindowHeight =460
|
|
|
|
open "Mandelbrot Set" for graphics_nsb_nf as #w
|
|
|
|
#w "trapclose [quit]"
|
|
#w "down"
|
|
|
|
for x0 = -2 to 1 step .0033
|
|
for y0 = -1.5 to 1.5 step .0075
|
|
x = 0
|
|
y = 0
|
|
|
|
iteration = 0
|
|
maxIteration = 255
|
|
|
|
while ( ( x *x +y *y) <=4) and ( iteration <maxIteration)
|
|
xtemp =x *x -y *y +x0
|
|
y =2 *x *y +y0
|
|
x = xtemp
|
|
iteration = iteration + 1
|
|
wend
|
|
|
|
if iteration <>maxIteration then
|
|
c =iteration
|
|
else
|
|
c =0
|
|
end if
|
|
|
|
call pSet x0, y0, c
|
|
scan
|
|
next
|
|
next
|
|
|
|
#w "flush"
|
|
|
|
wait
|
|
|
|
sub pSet x, y, c
|
|
xScreen = 10 +( x +2) /3 *400
|
|
yScreen = 10 +( y +1.5) /3 *400
|
|
if c =0 then
|
|
col$ ="red"
|
|
else
|
|
if c mod 2 =1 then col$ ="lightgray" else col$ ="white"
|
|
end if
|
|
#w "color "; col$
|
|
#w "set "; xScreen; " "; yScreen
|
|
end sub
|
|
|
|
[quit]
|
|
close #w
|
|
end
|