REM ***** MAD TEDDY'S MANDELBROT SET SERIES: REGION #18, variation B ***** REM x limits: -.2468599, -.2401932 REM y limits: -.7586905, -.7536905 SCREEN 12 iterationlimit = 1000 lowvaluecolouradjust = 0 black = 0 blue = 1 green = 2 cyan = 3 red = 4 magenta = 5 brown = 6 lightgrey = 7 darkgrey = 8 lightblue = 9 lightgreen = 10 lightcyan = 11 lightred = 12 lightmagenta = 13 yellow = 14 white = 15 oldylow = -.8 oldyhigh = -.7 oldxlow = -.34 oldxhigh = -.34 + .1 * 4 / 3 oldyrange = oldyhigh - oldylow oldxrange = oldxhigh - oldxlow ycentre = oldylow + (oldyrange) * 9.2 / 21 xcentre = oldxlow + (oldxrange) * 20.2 / 27.6 scalefactor = 1 / 20 yrange = oldyrange * scalefactor xrange = oldxrange * scalefactor ylow = ycentre - yrange / 2 yhigh = ycentre + yrange / 2 xlow = xcentre - xrange / 2 xhigh = xcentre + xrange / 2 REM fine tuning REM GOTO over ylow = ylow + yrange * 0 yhigh = yhigh + yrange * 0 xlow = xlow - xrange * 1 / 6 xhigh = xhigh - xrange * 1 / 6 over: FOR i = 0 TO 479 FOR j = 0 TO 639 x = xlow + j * (xhigh - xlow) / 639 y = yhigh - i * (yhigh - ylow) / 479 xc = x: yc = y iterations = 0 rsquared = 0 DO UNTIL rsquared >= 4 OR iterations > iterationlimit u = x * x - y * y + xc v = 2 * x * y + yc rsquared = u * u + v * v x = u: y = v iterations = iterations + 1 LOOP IF rsquared >= 4 THEN IF iterations > 140 THEN colour = yellow ELSEIF iterations > 105 THEN colour = lightred ELSEIF iterations > 85 THEN colour = lightgreen ELSEIF iterations > 70 THEN colour = lightblue ELSEIF iterations > 60 THEN colour = white ELSEIF (iterations + lowvaluecolouradjust) MOD 10 = 9 THEN colour = lightmagenta ELSEIF (iterations + lowvaluecolouradjust) MOD 10 = 8 THEN colour = lightcyan ELSEIF (iterations + lowvaluecolouradjust) MOD 10 = 7 THEN colour = brown ELSEIF (iterations + lowvaluecolouradjust) MOD 10 = 6 THEN colour = green ELSEIF (iterations + lowvaluecolouradjust) MOD 10 = 5 THEN colour = magenta ELSEIF (iterations + lowvaluecolouradjust) MOD 10 = 4 THEN colour = blue ELSEIF (iterations + lowvaluecolouradjust) MOD 10 = 3 THEN colour = red ELSEIF (iterations + lowvaluecolouradjust) MOD 10 = 2 THEN colour = lightgrey ELSEIF (iterations + lowvaluecolouradjust) MOD 10 = 1 THEN colour = cyan ELSEIF (iterations + lowvaluecolouradjust) MOD 10 = 0 THEN colour = darkgrey END IF ELSE colour = black END IF PSET (j, i), colour NEXT j NEXT i a$ = "" DO: a$ = INKEY$: LOOP UNTIL a$ = CHR$(27)