RosettaCodeData/Task/Mandelbrot-set/D/mandelbrot-set-2.d
2014-01-17 05:34:36 +00:00

8 lines
304 B
D

void main() {
import std.stdio, std.complex, std.range, std.algorithm;
foreach (immutable y; iota(-1.2, 1.2, 0.05))
iota(-2.05, 0.55, 0.03).map!(x => 0.complex
.recurrence!((a, n) => a[n - 1] ^^ 2 + complex(x, y))
.drop(100).front.abs < 2 ? '#' : '.').writeln;
}