diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-04 14:26:10 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-04 14:26:10 +0000 |
commit | dd9578b2c39127674a17a9e13fbf1a728969e789 (patch) | |
tree | b324afcd4fac0cda51f7ed351465bc18b7ef5e18 | |
parent | 80b190c164cf08d83ba8efb91bfcf556f9cc71f1 (diff) | |
download | aoc2021-dd9578b2c39127674a17a9e13fbf1a728969e789.tar.gz aoc2021-dd9578b2c39127674a17a9e13fbf1a728969e789.tar.xz aoc2021-dd9578b2c39127674a17a9e13fbf1a728969e789.zip |
day 4: unpack pos
-rw-r--r-- | 4.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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: |