// Pseudocode for a Julia set, adapted from Wikipedia: // https://en.wikipedia.org/wiki/Julia_set#Pseudocode_for_Normal_Julia_Sets for each tile (x, y) on the screen, do: // from map_coords, get: zx = complex real value of tile zy = complex imaginary value of tile iteration = 0 max_iterations = 1000 (argument $a2 in render) while (zx*zx + zy*zy < 4 AND iteration < max_iterations) { // Set cx and cy to the real and imaginary parts of complex number // c = -0.8 + 0.156i // So cx = -0.8, and cy = 0.156 xtemp = zx*zx - zy*zy zy = 2*zx*zy + cy zx = xtemp + cx iteration = iteration + 1 } if (iteration == max_iteration) print inSetColor and inSetSymbol; else print corresponding color and symbol; }