MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / get_offset

Function get_offset

Python/dijkstra.py:18–24  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

16
17# returns (y, x), index is 0-3 referencing north-west
18def get_offset(index):
19 return [
20 (-1, 0), # north
21 (0, 1), # east
22 (1, 0), # south
23 (0, -1) # west
24 ][index]
25
26# the opposite direction's index
27def get_opposite_index(index):

Callers 1

escape_routeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected