Mandelbrot

In Python

Godbolt does Python! (And lots of other languages…) import cmath # Set how far to zoom into the set, you can tweak this value scale = 25 # Calculate if each point in an x-y plane "escapes" the shape for y in range(-12, 12): for x in range(-55, 45): # Create a complex number based on current coordinates # Note the fudge factor of 2 because characters are taller than high c = complex(x / scale, y / scale * 2) # Initialise the calculation z = 0 # Check if calculation remains bounded (stays on the page) for _ in range(20): # THE IMPORTANT BIT! [Read More]