Percolation/Site percolation: Difference between revisions
→{{header|11l}}: make PercolatedException a non-fatal exception
m (→{{header|Wren}}: Minor tidy) |
Alextretyak (talk | contribs) (→{{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)
walk_maze(m, n, &cell, walk_index
R ex.t▼
▲ X.catch PercolatedException ex
▲ R ex.t
R N
|