From dd9578b2c39127674a17a9e13fbf1a728969e789 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Sat, 4 Dec 2021 14:26:10 +0000 Subject: day 4: unpack pos --- 4.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/4.py b/4.py index c75706c..5e60e52 100644 --- a/4.py +++ b/4.py @@ -18,12 +18,13 @@ class Board: def call(self, num: int) -> None: pos: tuple[int, int] | None = self.nums.pop(num, None) if pos is None: return - self.col_hits[pos[0]] -= 1 - self.row_hits[pos[1]] -= 1 + x, y = pos + self.col_hits[x] -= 1 + self.row_hits[y] -= 1 self.has_bingo = ( self.has_bingo or - not self.col_hits[pos[0]] or - not self.row_hits[pos[1]] + not self.col_hits[x] or + not self.row_hits[y] ) @property def unmarked_sum(self) -> int: -- cgit v1.2.3-54-g00ecf