This commit is contained in:
DUEFON 2022-12-13 00:54:53 +01:00
parent 4f973442e4
commit 202b162b63
2 changed files with 6 additions and 1 deletions

5
test12 Normal file
View File

@ -0,0 +1,5 @@
Sabqponm
abcryxxl
accszExk
acctuvwj
abdefghi

View File

@ -21,7 +21,7 @@ s = np.empty((h, w))
s.fill(h*w) # enough
tovisit = deque([S])
def visits(y, x):
return [(y+u-1, x+v-1) for u in range(3) for v in range(3)
return [(y+u-1, x+v-1) for (u, v) in [(2, 1), (0, 1), (1, 2), (1, 0)]
if y+u-1 >= 0 and y+u-1 < h and x+v-1 >= 0 and x+v-1 < w
and goto[u][v][y,x]]
#ic(a)