rem Julia set WindowWidth = 640: WindowHeight = 400 graphicbox #julset.gbox, 0, 0, 639, 399 open "Julia set" for window as #julset print #julset.gbox, "down" x0 = -0.512511498387847167 : y0 = 0.521295573094847167 for xp = 0 TO 639 for yp = 0 TO 399 x = xp / 213 - 1.5: y = yp / 200 - 1 iteration = 0 maxIteration = 100 while x * x + y * y <= 4 and iteration < maxIteration xtemp = x * x - y * y + x0 y = 2 * x * y + y0 x = xtemp iteration = iteration + 1 wend if iteration <> maxIteration then c = int(iteration * 255 / maxIteration + .5) else c = 0 print #julset.gbox, "color "; c; " "; c; " "; c print #julset.gbox, "set "; xp; " "; yp next yp next xp wait