SCREEN 12 iterationlimit = 100 colour0 = 14 colour1 = 4 colour2 = 5 colour3 = 2 colour4 = 1 colour5 = 8 iterationlimitcolour = 0 ylow = -1.25 yhigh = 1.25 xlow = -2.15 xhigh = xlow + (yhigh - ylow) * 4 / 3 FOR i = 0 TO 239 FOR j = 0 TO 319 x = xlow + j * (xhigh - xlow) / 319 y = yhigh - i * (yhigh - ylow) / 239 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 > 20 THEN colour = colour0 ELSEIF iterations > 6 THEN colour = colour1 ELSEIF iterations > 4 THEN colour = colour2 ELSEIF iterations > 2 THEN colour = colour3 ELSEIF iterations > 1 THEN colour = colour4 ELSE colour = colour5 END IF ELSE colour = iterationlimitcolour END IF PSET (j, i), colour NEXT j NEXT i ylownew = -.8 yhighnew = -.7 xlownew = -.34 xhighnew = xlownew + (yhighnew - ylownew) * 4 / 3 j1 = (xlownew - xlow) / (xhigh - xlow) * 319 j2 = (xhighnew - xlow) / (xhigh - xlow) * 319 i1 = 239 - (ylownew - ylow) / (yhigh - ylow) * 239 i2 = 239 - (yhighnew - ylow) / (yhigh - ylow) * 239 REM draw a white rectangle with those top left and bottom right corners LINE (j1, i1)-(j2, i2), 15, B a$ = "" DO: a$ = INKEY$: LOOP UNTIL a$ = CHR$(27)