From d75a9d510ced0a29ad2fe7ebc247dc7b0766320c Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Fri, 3 Dec 2021 16:56:16 +0000 Subject: Implement open_day utility function --- 2.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '2.py') diff --git a/2.py b/2.py index 618cd86..dd33814 100644 --- a/2.py +++ b/2.py @@ -1,3 +1,5 @@ +from utils import open_day + Command = tuple[str, int] def part1(commands: list[Command]) -> int: @@ -23,6 +25,6 @@ def part2(commands: list[Command]) -> int: depth += aim * X return pos * depth -commands: list[Command] = [(c, int(q)) for c, q in (l.split() for l in open('2.in'))] +commands: list[Command] = [(c, int(q)) for c, q in (l.split() for l in open_day(2))] print(part1(commands)) print(part2(commands)) -- cgit v1.2.3-70-g09d2