It would be very similar to the MANDEL.KC script I wrote for
EVALDRAW:
SCREEN 12
FOR sy% = 0 TO 479
FOR sx% = 0 TO 639
x = (sx% - 320) / 160: ox = x
y = (sy% - 240) / 160: oy = y
FOR c% = 15 TO 1 STEP -1
xx = x * x: yy = y * y
IF xx + yy >= 4 THEN EXIT FOR
y = x * y * 2 + oy
x = xx - yy + ox
NEXT
PSET (sx%, sy%), c%
NEXT
NEXT
If you were looking for fancy optimizations, you won't find them here. If I really cared, I would write the algorithm in assembly code, first using SSE (because it's easier), and then MMX - could be nearly twice the speed of SSE, although I don't know if the precision would be acceptable - I can't say for sure until trying. Of course, taking advantage of multithreading is a must. MANDEL.KC already does this since Evaldraw can take full advantage of HT/Dual core processors.