'Submitted by Craig Coleman
'I put this routine together back in 1990 based on Julia Set code.
SCREEN 12
CLS
INPUT "Interations (Try 10 or greater) =>"; iterations
INPUT "The limit (This must be less than the Iterations) =>"; limit
INPUT "Number of colors (16 is the most) =>"; mVal
REM iterations = trunc(r8)
CLS
xScale = 100
xAdj = -200
yScale = 100
yAdj = -200
FOR j = 0 TO 400
y1 = (yAdj + j) / yScale
FOR i = 0 TO 400
x1 = (i + xAdj) / xScale
c1 = x1
c2 = y1
x = 0
y = 0
k = 0
z = 0
DO WHILE ((k < iterations) AND (z < 4!))
x2 = (x * x) - (y * y) + c1
y = (2 * x * y) + c2
x = x2
z = (x * x) + (y * y)
k = k + 1
LOOP
kv = k MOD mVal
c = kv
IF (k >= limit) THEN
PSET (i, j), c
END IF
NEXT i
NEXT j