Day 12 (removed comments)

This commit is contained in:
Sebastian Seedorf
2020-12-12 11:24:11 +01:00
parent 487f22daba
commit 1121918434
2 changed files with 0 additions and 4 deletions

View File

@@ -24,13 +24,11 @@ def rotate(current, amount):
for line in lines:
print(line)
if line[0] in target_str:
pos += direction(line[0]) * line[1]
elif line[0] in "LR":
drctn = rotate(drctn, -line[1] if line[0] == "R" else line[1])
else:
pos += drctn * line[1]
print(pos, drctn)
print(sum(np.abs(pos)))

View File

@@ -24,13 +24,11 @@ def rotate(current, amount):
for line in lines:
print(line)
if line[0] in target_str:
drctn += direction(line[0]) * line[1]
elif line[0] in "LR":
drctn = rotate(drctn, -line[1] if line[0] == "R" else line[1])
else:
pos += drctn * line[1]
print(pos, drctn)
print(sum(np.abs(pos)))