Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Coordinate grid solution in Clear category for Compass, Map and Spyglass by quarkov
def steps(a, b):
return max(abs(a[0] - b[0]), abs(a[1] - b[1]))
def navigation(seaside):
crds_dict = {"Y": [0, 0], "C": [0, 0], "M": [0, 0], "S": [0, 0]}
for line in seaside:
for point in line:
if point != 0:
crds_dict[point] = [seaside.index(line), line.index(point)]
y, c, m, s = crds_dict["Y"], crds_dict["C"], crds_dict["M"], crds_dict["S"]
return steps(y, c) + steps(y, m) + steps(y, s)
Sept. 6, 2018