Anonymous user
Percolation/Bond percolation: Difference between revisions
Updated D entry
(Updated D entry) |
(Updated D entry) |
||
Line 190:
void initialize(in double prob, ref Xorshift rng) {
cells[0 .. nc] = bottomWall | rightWall; // First row.
Line 203 ⟶ 195:
foreach (immutable r; 1 .. nr + 1) {
foreach (immutable c; 1 .. nc)
cells[pos++] = (
(
cells[pos++] = rightWall |
(uniform01 < prob ? bottomWall : empty);
}
|