Very simple Python implementation for plotting the Mandelbrot set on screen
Source: https://en.wikipedia.org/wiki/Mandelbrot_set
Pseudocode:
for each pixel (Px, Py) on the screen do x0 = scaled x coordinate of pixel (scaled to lie in the Mandelbrot X scale (-2.5, 1)) y0 = scaled y coordinate of pixel (scaled to lie in the Mandelbrot Y scale (-1, 1)) x := 0.0 y := 0.0 iteration := 0 max_iteration := 1000 while (xx + yy ≤ 22 AND iteration < max_iteration) do xtemp := xx - yy + x0 y := 2x*y + y0 x := xtemp iteration := iteration + 1 color := palette[iteration] plot(Px, Py, color)