View source code
Display the source code in std/stdio.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Function std.stdio.File.lockingBinaryWriter

Returns an output range that locks the file and allows fast writing to it.

std.stdio.File.BinaryWriterImpl!(true) lockingBinaryWriter();


Produce a grayscale image of the Mandelbrot set in binary Netpbm format to standard output.

import std.algorithm, std.complex, std.range, std.stdio;

void main()
    enum size = 500;
    writef("P5\n%d %d %d\n", size, size, ubyte.max);

    iota(-1, 3, 2.0/size).map!(y =>
        iota(-1.5, 0.5, 2.0/size).map!(x =>
                recurrence!((a, n) => x + y * complex(0, 1) + a[n-1]^^2)(complex(0))
                .countUntil!(z =>^^2 +^^2 > 4))


Walter Bright, Andrei Alexandrescu, Alex Rønne Petersen


Boost License 1.0.