Sierpinski triangle/Graphical: Difference between revisions

Content added Content deleted
(added autohotkey)
(Updated D entry)
Line 373: Line 373:
The output image is the same as the Go version. This requires the module from the Grayscale image Task.
The output image is the same as the Go version. This requires the module from the Grayscale image Task.
{{trans|Go}}
{{trans|Go}}
<lang d>import grayscale_image;
<lang d>void main() {
import grayscale_image;


void main() {
enum order = 8,
enum order = 8,
margin = 10,
margin = 10,
Line 383: Line 383:
im.clear(Gray.white);
im.clear(Gray.white);


foreach (y; 0 .. width)
foreach (immutable y; 0 .. width)
foreach (x; 0 .. width)
foreach (immutable x; 0 .. width)
if ((x & y) == 0)
if ((x & y) == 0)
im[x + margin, y + margin] = Gray.black;
im[x + margin, y + margin] = Gray.black;