ehh
This commit is contained in:
parent
c6b5153768
commit
7f94fcfba0
|
@ -119,14 +119,14 @@ def navigate2(instructions):
|
||||||
wx, wy = -wx, -wy
|
wx, wy = -wx, -wy
|
||||||
elif value == 270:
|
elif value == 270:
|
||||||
wx, wy = -wy, wx
|
wx, wy = -wy, wx
|
||||||
return x, y
|
return x, y, wx, wy
|
||||||
|
|
||||||
def part1(instructions):
|
def part1(instructions):
|
||||||
x, y, direction = navigate(instructions)
|
x, y, direction = navigate(instructions)
|
||||||
return abs(x) + abs(y)
|
return abs(x) + abs(y)
|
||||||
|
|
||||||
def part2(instructions):
|
def part2(instructions):
|
||||||
x, y = navigate2(instructions)
|
x, y, wx, wy = navigate2(instructions)
|
||||||
return abs(x) + abs(y)
|
return abs(x) + abs(y)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
Loading…
Reference in a new issue