#!/usr/bin/env python #Fractalss ver 0.1 #Vadim Kataev 2006 #www.compuvisor.net #www.technopedia.org #vkataev at gmail.com # Modified by Charles Wicksteed, June 2022 import pygame, time import pygame.locals SCREEN_WIDTH=120; SCREEN_HEIGHT=200 CENTER_X=SCREEN_WIDTH/2; CENTER_Y=SCREEN_HEIGHT/2 max_iteration = 70 scale = 3.0/(SCREEN_HEIGHT*500.0) def init(): global screen pygame.init() screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) pygame.display.set_caption('Mandelbrot') def main(): screen.fill((255, 255, 255)) if (draw_field(screen) == "DONE"): # wait for user to close window running = True while running: event = pygame.event.wait() if event.type == pygame.locals.QUIT: running = False # else if draw_field() returns "QUIT", then quit immediately # Mandelbrot Set def iteration(cx, cy): i = 0 zx = 0 zy = 0 while zx * zx + zy * zy < 4.0 and i