Day 19 (bug fix)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
lines = (x.strip() for x in open("input.txt"))
|
||||
rules = {}
|
||||
sum = 0
|
||||
cnt = 0
|
||||
|
||||
|
||||
def yield_rule(line, rule):
|
||||
@@ -30,7 +30,5 @@ for line in lines:
|
||||
r = r[1:len(r)-1] if r.startswith('"') else [list(map(int, x.split())) for x in r.split(" | ")]
|
||||
rules[idx] = r
|
||||
elif line != "":
|
||||
for rest in check(line, 0):
|
||||
if rest == "":
|
||||
sum += 1
|
||||
print(sum)
|
||||
cnt += 1 if next(check(line, 0), None) == "" else 0
|
||||
print(cnt)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
lines = (x.strip() for x in open("input.txt"))
|
||||
rules = {}
|
||||
sum = 0
|
||||
cnt = 0
|
||||
|
||||
|
||||
def yield_rule(line, rule, depth):
|
||||
@@ -34,7 +34,5 @@ for line in lines:
|
||||
r = r[1:len(r)-1] if r.startswith('"') else [list(map(int, x.split())) for x in r.split(" | ")]
|
||||
rules[idx] = r
|
||||
elif line != "":
|
||||
for rest in check(line, 0, len(line)):
|
||||
if rest == "":
|
||||
sum += 1
|
||||
print(sum)
|
||||
cnt += 1 if next(check(line, 0, len(line)), None) == "" else 0
|
||||
print(cnt)
|
||||
|
||||
Reference in New Issue
Block a user