Percolation/Bond percolation: Difference between revisions

Updated D entry
(Fixed performance problem in the D entry.)
(Updated D entry)
Line 266:
nr, nc, nTries);
foreach (immutable p; 0 .. nStepsProb) {
immutable probability = p / cast(double)(nStepsProb);
uint nPercolated = 0;
foreach (immutable i; 0 .. nTries) {
Line 273:
}
writefln("p = %0.2f: %.4f",
probability, nPercolated / cast(double)(nTries));
}
}</lang>