diff --git a/2021/15/15.py b/2021/15/15.py index bba14a1..45b3a04 100755 --- a/2021/15/15.py +++ b/2021/15/15.py @@ -1,10 +1,11 @@ #!/usr/bin/env python # 2021 - Advent Of Code - 15 -# 2022: cheat for pylint to start fresh for 2022 -# pylint: skip-file # unfinished -class Color: +from typing import NamedTuple + + +class Color(NamedTuple): PURPLE = '\033[95m' CYAN = '\033[96m' DARKCYAN = '\033[36m' @@ -27,8 +28,9 @@ def parse_file(file): def print_grid(grid): - for y in range(len(grid)): - for x in range(len(grid[y])): + # pylint: disable=unnecessary-list-index-lookup + for y, _ in enumerate(grid): + for x, _ in enumerate(grid[y]): print(grid[y][x], end='') print() print() @@ -37,5 +39,5 @@ def print_grid(grid): cave_map = parse_file('input_example.txt') print_grid(cave_map) - +color = Color() print(color.BOLD + 'Hello World !' + color.END) diff --git a/2022/11/11.py b/2022/11/11.py index 2574824..500b800 100644 --- a/2022/11/11.py +++ b/2022/11/11.py @@ -9,6 +9,7 @@ # If false: throw to monkey 3 class Monkey: + # pylint: disable=too-many-arguments def __init__(self, sitems, op, op2, divisible, ta, tf): self.items = sitems self.operation = op