13) Escape the Void!

Before clicking the link, look at what this code does.
  • Line 27 & 29: What do the first two for loops do?
  • Line 36: Within the third for loop, what happens if (zr * zr) + (zi * zi) never gets to be greater than 4?
  • Line 37: Is z%17 even necessary in this example?
  • Line 14: How much difference is there when depth is a smaller number compared to a larger one?



Here’s the link to a simple HTML page consisting of the above source code (please give it a few seconds to paint every pixel in the window):


The image is called the Mandelbrot Set.