REM ***** MAD TEDDY'S MANDELBROT SET SERIES: REGION #3 ***** REM x limits: -.714, -.394 REM y limits: .47, .71 SCREEN 12 iterationlimit = 1000 iterationlimitcolour = 0 brown = 6 yellow = 14 red = 4 purple = 5 green = 2 blue = 1 darkgrey = 8 ylow = .59 - .12 yhigh = .59 + .12 xlow = -.554 - .16 xhigh = -.554 + .16 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 > 200 THEN colour = brown ELSEIF iterations > 40 THEN colour = yellow ELSEIF iterations > 20 THEN colour = red ELSEIF iterations > 13 THEN colour = purple ELSEIF iterations > 10 THEN colour = green ELSEIF iterations > 9 THEN colour = blue ELSE colour = darkgrey END IF ELSE colour = iterationlimitcolour END IF PSET (j, i), colour NEXT j NEXT i a$ = "" DO: a$ = INKEY$: LOOP UNTIL a$ = CHR$(27)