Skip to content

Commit

Permalink
[2019] add 'p1:' & 'p2:' to outputs for each day
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlitGhost committed Dec 25, 2023
1 parent 1fb4c96 commit 92a3aae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions 2019/1/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


if __name__ == "__main__":
print(sum(mod // 3 - 2 for mod in map(int, aoc.by_lines())))
print('p1:', sum(mod // 3 - 2 for mod in map(int, aoc.by_lines())))

total_fuel = 0
for mod in map(int, aoc.by_lines()):
Expand All @@ -14,4 +14,4 @@
if fuel_fuel > 0:
mod_fuel += fuel_fuel
total_fuel += mod_fuel
print(total_fuel)
print('p2:', total_fuel)
6 changes: 3 additions & 3 deletions 2019/3/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def create_wire(wire: list[str]) -> set:
steps = 0
visited = defaultdict(list)
for v in wire:
d = Vec2({'U': Dir.UP, 'D': Dir.DOWN, 'L': Dir.LEFT, 'R': Dir.RIGHT}[v[0]])
d = Vec2(Dir.map_udlr('UDLR')[v[0]])
magnitude = int(v[1:])
offset = d * magnitude
end = start + offset
Expand Down Expand Up @@ -64,5 +64,5 @@ def test():

closest, fewest = closest_intersection(wires)

print(closest)
print(fewest)
print('p1:', closest)
print('p2:', fewest)
4 changes: 2 additions & 2 deletions 2019/5/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
outputs = []
cpu = IntCode(aoc.read(), input_gen=(n for n in [1]), output=outputs.append)
cpu.process()
print(outputs)
print('p1:', outputs[-1])

outputs = []
cpu = IntCode(aoc.read(), input_gen=(n for n in [5]), output=outputs.append)
cpu.process()
print(outputs)
print('p2:', outputs[-1])

0 comments on commit 92a3aae

Please sign in to comment.