Anonymous user
Percolation/Site percolation: Difference between revisions
Simpler grid printing in the D entry (as the Racket version)
(=={{header|Racket}}== implementation added) |
(Simpler grid printing in the D entry (as the Racket version)) |
||
Line 199:
void show(in ref Grid grid) {
foreach (const ref row; grid)
writeln('|', cast(BaseType[nCols])row, '|');
}
Line 284 ⟶ 281:
{{out}}
<pre>Percolating sample (15x15, probability = 0.30):
|..####
|
|
|
|#
|##
|
|
|## # ###
| #
|# ##
|
|
|##
▲|######### .####|
Fraction of 20000 tries that percolate through:
Line 307 ⟶ 302:
0.200 0.000
0.300 0.000
0.400 0.
0.500 0.
0.600 0.
0.700 0.
0.800 1.000
0.900 1.000
|