#title "strol" #author "strol" #include meteor2 export OnMapStart; void OnMapStart() { int x, y, n; int w = 500, h = 500; int cycles = 25; double minR = -2.0, maxR = 1.0; double minI = -1.2, maxI = 1.2; double rFact = (maxR - minR) / w; double iFact = (maxI - minI) / h; double r, i, Zr, Zi, Zr2, Zi2; for (y = 0; y < h; ++y) { i = maxI - y * iFact; for (x = 0; x < w; ++x) { r = minR + x * rFact; Zr = r; Zi = i; n = 0; while (n < cycles && Zr * Zr + Zi * Zi < 4.0) { Zr2 = Zr * Zr; Zi2 = Zi * Zi; Zi = 2.0 * Zr * Zi + i; Zr = Zr2 - Zi2 + r; ++n; } if (n > cycles * 0.85 && n != cycles) SC_AddSprite( "objects\\crate.spr", 3 * x, 3 * y, 224, 0); } } }