lint
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
kleph 2022-04-05 14:02:10 +02:00
parent ba86d90e98
commit d2af5b8bad
7 changed files with 10 additions and 4 deletions

View file

@ -30,6 +30,7 @@ def check_flash(grid, f):
def flash(grid, x, y, f):
# pylint: disable=R0912
grid[y][x] = 0
f += 1
if y > 0: # upper neighbours

View file

@ -30,6 +30,7 @@ def check_flash(grid, f):
def flash(grid, x, y, f):
# pylint: disable=R0912
grid[y][x] = 0
f += 1
if y > 0: # upper neighbours

View file

@ -15,6 +15,7 @@ def parse_file(file):
def step_poly(poly_str, ruleset):
new_p = []
p = None
for i, p in enumerate(poly_str):
if i + 1 == len(poly_str):
break

View file

@ -53,13 +53,13 @@ for s in range(40):
print(f'poly count: {poly_count}')
elements = set([k for key in poly_count.keys() for k in (key[0], key[1])])
elements = ([k for key, value in poly_count.items() for k in (key[0], key[1])])
print(f'elements: {elements}')
elem_count = dict.fromkeys(elements, 0)
for polymer in poly_count.keys():
elem_count[polymer[0]] += poly_count[polymer]
elem_count[polymer[1]] += poly_count[polymer]
for polymer, count in poly_count.items():
elem_count[polymer[0]] += count
elem_count[polymer[1]] += count
# remove double count, and fix first and last element
elem_count[first_last[0]] += 1

View file

@ -15,6 +15,7 @@ def parse_file(file):
def step_poly(poly_str, ruleset):
new_p = []
p = None
l_poly = len(poly_str)
for i, p in enumerate(poly_str):
if i + 1 == l_poly:

1
9/9.py
View file

@ -21,6 +21,7 @@ def print_hmap(hmap):
def find_lowpoints(hmap):
# pylint: disable=R0912
lpoints = []
# first line

View file

@ -14,6 +14,7 @@ def parse_file(file):
def find_lowpoints(hmap):
# pylint: disable=R0912
lpoints = []
# first line