diff --git a/test12 b/test12 new file mode 100644 index 0000000..86e9cac --- /dev/null +++ b/test12 @@ -0,0 +1,5 @@ +Sabqponm +abcryxxl +accszExk +acctuvwj +abdefghi diff --git a/twelve.py b/twelve.py index 4aaaef6..ff35b26 100755 --- a/twelve.py +++ b/twelve.py @@ -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)