Percolation/Site percolation: Difference between revisions

→‎{{header|11l}}: make PercolatedException a non-fatal exception
m (→‎{{header|Wren}}: Minor tidy)
(→‎{{header|11l}}: make PercolatedException a non-fatal exception)
Line 48:
print(‘!) ’(‘ ’ * where)‘’:cell2char[cell[:nn - 1][where]])
 
F walk_maze(m, n, &cell, indx) X(PercolatedException) -> N
cell[n][m] = indx
I n < :nn - 1 & cell[n + 1][m] == :NOT_VISITED
Line 63:
F check_from_top(&cell) -> (Int, Int)?
V (n, walk_index) = (0, 1)
XL(m) 0 .try< :M
L(m)I 0cell[n][m] .<== :MNOT_VISITED
I cell[n][m] == :NOT_VISITEDwalk_index++
walk_maze(m, n, &cell, walk_index++)
X.catchhandle PercolatedException ex
walk_maze(m, n, &cell, walk_index)
R ex.t
X.catch PercolatedException ex
R ex.t
R N
 
1,481

edits