day12: no need to re-evaluate where in p2
This commit is contained in:
parent
20e35877e2
commit
38032fbb6e
3
day12.py
3
day12.py
@ -48,8 +48,7 @@ def moveWaypoint(instruction, posShipX, posShipY, posWaypointX, posWaypointY):
|
|||||||
if where == 'F':
|
if where == 'F':
|
||||||
posShipX += posWaypointX * dist
|
posShipX += posWaypointX * dist
|
||||||
posShipY += posWaypointY * dist
|
posShipY += posWaypointY * dist
|
||||||
|
elif where == 'N':
|
||||||
if where == 'N':
|
|
||||||
posWaypointY -= dist
|
posWaypointY -= dist
|
||||||
elif where == 'S':
|
elif where == 'S':
|
||||||
posWaypointY += dist
|
posWaypointY += dist
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user