Percolation/Mean cluster density: Difference between revisions

m
m (Made code more C++ idiomatic.)
 
(One intermediate revision by one other user not shown)
Line 40:
R (0 .< n).map(i -> (0 .< @n).map(i -> Int(nonrandom() < @@p)))
 
F walkMaze(&grid, m, n, idx) -> NVoid
grid[n][m] = idx
I n < grid.len - 1 & grid[n + 1][m] == NotClustered
Line 2,056:
{{trans|Kotlin}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascriptwren">import "random" for Random
import "./fmt" for Fmt
 
var rand = Random.new()
1,481

edits