diff --git a/d12.py b/d12.py index 8a80cf5..1146520 100644 --- a/d12.py +++ b/d12.py @@ -39,7 +39,7 @@ def solve(lines: list[str], repeat=1): all = [] for (_, line) in enumerate(lines): springs, numbers = line.split() - numbers = tuple(lib.str_to_int_list(numbers)) + numbers = tuple(lib.str_to_ints(numbers)) ns = "?".join([springs for _ in range(repeat)]) all.append((tuple(ns), numbers * repeat)) diff --git a/d19.py b/d19.py index 52fa6bf..c9e27a6 100644 --- a/d19.py +++ b/d19.py @@ -140,10 +140,9 @@ def main(): # 25:00 print("Example 2:", solve(Input(EXAMPLE), True)) - print("Correct 2:", 167409079868000) + assert solve(Input(EXAMPLE), True) == 167409079868000 print("Solution 2:", solve(Input(DAY_INPUT), True)) # 120:00 - return if __name__ == "__main__": main() diff --git a/d20.py b/d20.py index 40f53b1..5d36e4c 100644 --- a/d20.py +++ b/d20.py @@ -103,6 +103,7 @@ def main(): print("Example 2:", solve(Input(EXAMPLE2))) print("Solution 1:", solve(Input(DAY_INPUT))) print("Solution 2:", solve(Input(DAY_INPUT), True)) + assert solve(Input(DAY_INPUT), True) == 244178746156661 if __name__ == "__main__": main() diff --git a/d9.py b/d9.py index dadaebe..602f794 100644 --- a/d9.py +++ b/d9.py @@ -9,7 +9,7 @@ EXAMPLE = """ def solve(lines: list[str]): res = 0 for (i, line) in enumerate(lines): - digits = lib.str_to_int_list(line) + digits = lib.str_to_ints(line) last_digits = [] while not all(d == 0 for d in digits): last_digits.append(digits[-1]) @@ -24,7 +24,7 @@ def solve(lines: list[str]): def solve2(lines: list[str]): res = 0 for (i, line) in enumerate(lines): - digits = lib.str_to_int_list(line) + digits = lib.str_to_ints(line) first_digits = [] while not all(d == 0 for d in digits): first_digits.append(digits[0])