REM ***** MAD TEDDY'S MANDELBROT SET SERIES: REGION #2 ***** REM x limits: -.34, -.2066666 REM y limits: -.8, -.7 SCREEN 12 iterationlimit = 1000 colour0 = 14 colour1 = 4 colour2 = 5 colour3 = 2 colour4 = 1 colour5 = 8 iterationlimitcolour = 0 ylow = -.8 yhigh = -.7 xlow = -.34 xhigh = xlow + (yhigh - ylow) * 4 / 3 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 > 30 THEN colour = colour0 ELSEIF iterations > 16 THEN colour = colour1 ELSEIF iterations > 12 THEN colour = colour2 ELSEIF iterations > 8 THEN colour = colour3 ELSEIF iterations > 3 THEN colour = colour4 ELSE colour = colour5 END IF ELSE colour = iterationlimitcolour END IF PSET (j, i), colour NEXT j NEXT i a$ = "" DO: a$ = INKEY$: LOOP UNTIL a$ = CHR$(27)