REM ***** MAD TEDDY'S MANDELBROT SET SERIES: REGION #19, variation "_" ***** REM ***** WILDERNESS IN AUTUMN ***** SCREEN 12 iterationlimit = 1000 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 ylow = .626 - .012: REM .614 yhigh = .626 + .012: REM .638 xlow = -.527 - .016: REM -.543 xhigh = -.527 + .016: REM -.511 xcentre = -.543 + (-.511 + .543) * 25.9 / 27.6 ycentre = .614 + (.638 - .614) * 11 / 21 yhalfheight = (.638 - .614) * 1 / 21 * 2 * 10 xhalflength = yhalfheight * 4 / 3 ylow = ycentre - yhalfheight yhigh = ycentre + yhalfheight xlow = xcentre - xhalflength - xhalflength * 2 / 3 xhigh = xcentre + xhalflength - xhalflength * 2 / 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 > 45 THEN colour = brown ELSEIF iterations > 45 THEN colour = white ELSEIF iterations > 30 THEN colour = green ELSEIF iterations > 25 THEN colour = lightgreen ELSEIF iterations > 21 THEN colour = lightblue ELSEIF iterations > 18 THEN colour = lightcyan ELSEIF iterations > 16 THEN colour = cyan ELSEIF iterations > 14 THEN colour = blue ELSE 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)