Day 12 (made direction order more satisfying)
This commit is contained in:
@@ -2,8 +2,8 @@ lines = ((x[0], int(x[1:].strip())) for x in open("input.txt"))
|
|||||||
|
|
||||||
pos = 0
|
pos = 0
|
||||||
drctn = 1
|
drctn = 1
|
||||||
targets = [1j, 1, -1j, -1]
|
targets = [1, 1j, -1, -1j]
|
||||||
target_str = "NESW"
|
target_str = "ENWS"
|
||||||
|
|
||||||
for cmd, num in lines:
|
for cmd, num in lines:
|
||||||
if cmd in target_str:
|
if cmd in target_str:
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ lines = ((x[0], int(x[1:].strip())) for x in open("input.txt"))
|
|||||||
|
|
||||||
pos = 0
|
pos = 0
|
||||||
drctn = 10+1j
|
drctn = 10+1j
|
||||||
targets = [1j, 1, -1j, -1]
|
targets = [1, 1j, -1, -1j]
|
||||||
target_str = "NESW"
|
target_str = "ENWS"
|
||||||
|
|
||||||
for cmd, num in lines:
|
for cmd, num in lines:
|
||||||
if cmd in target_str:
|
if cmd in target_str:
|
||||||
|
|||||||
Reference in New Issue
Block a user