Day 19 (cleanup)

This commit is contained in:
Sebastian Seedorf
2020-12-19 13:07:01 +01:00
parent 86be05b9f1
commit 7e219104ec
2 changed files with 10 additions and 11 deletions

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python3
import re
lines = (x.strip() for x in open("input.txt"))
rules = {}

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python3
import re
lines = (x.strip() for x in open("input.txt"))
rules = {}
@@ -15,7 +14,8 @@ def yield_rule(line, rule, depth):
def check(line, idx, depth=0):
if depth <= 100:
if depth > 100:
return
rs = rules[idx]
if isinstance(rs, str):
if line.startswith(rs):