diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-04 13:47:01 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-04 13:47:01 +0000 |
commit | 499f45e61349a7d2f6ddbd0c9b69ca79cd530d1c (patch) | |
tree | eb493235d2ce6f961817c51661c03e4b744bad22 | |
parent | 9469e9bbaff17ee0f27f03a403e389364a2c244a (diff) | |
download | aoc2021-499f45e61349a7d2f6ddbd0c9b69ca79cd530d1c.tar.gz aoc2021-499f45e61349a7d2f6ddbd0c9b69ca79cd530d1c.tar.xz aoc2021-499f45e61349a7d2f6ddbd0c9b69ca79cd530d1c.zip |
day 4: fix position calculation blunder
-rw-r--r-- | 4.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -26,8 +26,8 @@ class Board: 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 - self.row_hits[pos // self.height] += 1 + self.col_hits[pos % self.width] += 1 + self.row_hits[pos // self.width] += 1 self.unmarked_sum -= num self.has_bingo = ( any(hits == self.height for hits in self.col_hits) or |