Jump to content

Percolation/Site percolation: Difference between revisions

Small improvements in the D entry
(+ C entry)
(Small improvements in the D entry)
Line 237:
immutable r = rng.front / cast(double)rng.max;
rng.popFront;
cell = (r < probability) ? Cell.empty : Cell.filled;
}
}
Line 245:
line.writeln;
foreach (const ref row; grid)
writeln('|' ~, cast(BaseType[nCols])row ~, '|');
line.writeln;
}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.