mirror of
https://github.com/thib8956/advent-of-code.git
synced 2026-05-25 19:53:26 +00:00
2025 day 2 and 3
This commit is contained in:
@@ -10,7 +10,6 @@ def part1(lines):
|
||||
print("Part 1: ", cnt)
|
||||
|
||||
|
||||
|
||||
def part2(lines):
|
||||
pos = 50
|
||||
cnt = 0
|
||||
@@ -27,17 +26,17 @@ def part2(lines):
|
||||
if amount >= k0:
|
||||
cnt += 1 + (amount - k0) // 100
|
||||
pos = (pos + direction * amount) % 100
|
||||
print(rotation, pos, cnt)
|
||||
# print(rotation, pos, cnt)
|
||||
print("Part 2: ", cnt)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
infile = sys.argv[1]
|
||||
|
||||
|
||||
with open(infile) as f:
|
||||
lines = f.readlines()
|
||||
lines = [x.rstrip() for x in lines]
|
||||
part1(lines)
|
||||
part2(lines)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user