MCPcopy Create free account
hub / github.com/CompVis/zigma / zigzag_path_lr

Function zigzag_path_lr

utils/utils_zigzag.py:145–152  ·  view source on GitHub ↗
(N, start_row=0, start_col=0, dir_row=1, dir_col=1)

Source from the content-addressed store, hash-verified

143
144def zigzag_path(N):
145 def zigzag_path_lr(N, start_row=0, start_col=0, dir_row=1, dir_col=1):
146 path = []
147 for i in range(N):
148 for j in range(N):
149 # If the row number is even, move right; otherwise, move left
150 col = j if i % 2 == 0 else N - 1 - j
151 path.append((start_row + dir_row * i) * N + start_col + dir_col * col)
152 return path
153
154 def zigzag_path_tb(N, start_row=0, start_col=0, dir_row=1, dir_col=1):
155 path = []

Callers 1

zigzag_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected