summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2021-12-04 13:40:22 +0000
committerTomasz Kramkowski <tk@the-tk.com>2021-12-04 13:40:22 +0000
commit9469e9bbaff17ee0f27f03a403e389364a2c244a (patch)
tree599bdfd6f985438dbb756b65337f0115714938be
parent9de28ee17932d949a12381bf5a8de95b5ea7332b (diff)
downloadaoc2021-9469e9bbaff17ee0f27f03a403e389364a2c244a.tar.gz
aoc2021-9469e9bbaff17ee0f27f03a403e389364a2c244a.tar.xz
aoc2021-9469e9bbaff17ee0f27f03a403e389364a2c244a.zip
day 4: more type annotations
-rw-r--r--4.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/4.py b/4.py
index f08659b..eeb929e 100644
--- a/4.py
+++ b/4.py
@@ -10,7 +10,7 @@ class Board:
has_bingo: bool
unmarked_sum: int
nums: set[int]
- def __init__(self, cells: list[list[int]]):
+ def __init__(self, cells: list[list[int]]) -> None:
self.width = len(cells[0])
self.height = len(cells)
self.col_hits = [0] * self.width
@@ -23,7 +23,7 @@ class Board:
self.cells.append(cell)
self.nums.add(cell)
self.has_bingo = False
- def call(self, num: int):
+ def call(self, num: int) -> None:
if num not in self.nums: return
pos: int = self.cells.index(num)
self.col_hits[pos // self.width] += 1