clear screen print at (32, 1) "MANDELBROT SET" print at (2, 3) "To enlarge part of the fractal simply click on it when drawing is finished." print at (2, 5) "Press any key to start." inkey$ clear screen open window 640, 480 backcolor 0, 0, 0 clear window clear window pow = 1 przesx = 0 przesy = 0 do przelx = 3 / (640 * pow) przely = 2 / (480 * pow) for x = 0 to 639 for y = 0 to 479 a = 0 b = 0 c = 0 x2 = (przelx * (x + (przesx * pow))) - 2 y2 = (przely * (y + (przesy * pow))) - 1 while (c < 50) a2 = a * a - b * b b2 = 2 * a * b a = a2 + x2 b = b2 + y2 z = a * a + b * b if z >= 4 then break endif c = c + 1 wend if (c = 50) then color 0, 0, 0 elseif (c < 17) then color 245 - ((17 - c) * 3), 0, 0 elseif (c < 33) then color 245, ((c - 16) * 16) - 16, 0 else color 641 - (c * 12), 245, ((c - 32) * 15) endif dot x, y next y next x inkey$ if pow < 2501 then przesx = przesx + mousex / pow przesy = przesy + mousey / pow pow = pow * 50 else pow = 1 przesx = 0 przesy = 0 endif loop end