'Mandelbrot Set Generator in QuickBASIC 'by Robert John Morton 'TO GENERATE THE MANDLEBROT SET [Compiled as mandel.exe] screen 9, 3 : locate 1,1 xbias = 400 : ybias = 200 cy = -1.5 A: cx = -2.5 B: x = .01 : y = .01 : i = 0 L: if inkey$ > "" then locate 24,1: print"Terminated by User";:end end if z = x * y 'square x + iy and add cx + icy x = x * x - y * y + cx y = z + z + cy for j = 1 to 50 : next 'delay re GCA display problem if x < -2 or x > +2 or y < -2 or y > +2 goto Q 'diverged if i < 500 then i = i + 1 : goto L M: if cx < 1 then cx = cx + .01 : goto B if cy < 1.5 then cy = cy + .01 : goto A end Q: if i < 10 then c = 9 'blue elseif i < 20 then c = 10 'green elseif i < 40 then c = 11 'cyan elseif i < 80 then c = 12 'red elseif i < 160 then c = 13 'purple else c = 14 'yellow end if P: pset(xbias + cx * 150, ybias - cy * 100), c : goto M # 1997 Robert John Morton