Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
|
|
@ -24,7 +24,7 @@ F pgrid(cell, percolated)
|
|||
V where = percolated[0]
|
||||
print(‘!) ’(‘ ’ * where)‘’:cell2char[cell[:nn - 1][where]])
|
||||
|
||||
F walk_maze(m, n, &cell, indx) -> N
|
||||
F walk_maze(m, n, &cell, indx) X(PercolatedException) -> N
|
||||
cell[n][m] = indx
|
||||
I n < :nn - 1 & cell[n + 1][m] == :NOT_VISITED
|
||||
walk_maze(m, n + 1, &cell, indx)
|
||||
|
|
@ -39,13 +39,12 @@ F walk_maze(m, n, &cell, indx) -> N
|
|||
|
||||
F check_from_top(&cell) -> (Int, Int)?
|
||||
V (n, walk_index) = (0, 1)
|
||||
X.try
|
||||
L(m) 0 .< :M
|
||||
I cell[n][m] == :NOT_VISITED
|
||||
walk_index++
|
||||
walk_maze(m, n, &cell, walk_index)
|
||||
X.catch PercolatedException ex
|
||||
R ex.t
|
||||
L(m) 0 .< :M
|
||||
I cell[n][m] == :NOT_VISITED
|
||||
walk_index++
|
||||
walk_maze(m, n, &cell, walk_index)
|
||||
X.handle PercolatedException ex
|
||||
R ex.t
|
||||
R N
|
||||
|
||||
V sample_printed = 0B
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue