summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2021-12-04 13:47:01 +0000
committerTomasz Kramkowski <tk@the-tk.com>2021-12-04 13:47:01 +0000
commit499f45e61349a7d2f6ddbd0c9b69ca79cd530d1c (patch)
treeeb493235d2ce6f961817c51661c03e4b744bad22
parent9469e9bbaff17ee0f27f03a403e389364a2c244a (diff)
downloadaoc2021-499f45e61349a7d2f6ddbd0c9b69ca79cd530d1c.tar.gz
aoc2021-499f45e61349a7d2f6ddbd0c9b69ca79cd530d1c.tar.xz
aoc2021-499f45e61349a7d2f6ddbd0c9b69ca79cd530d1c.zip
day 4: fix position calculation blunder
-rw-r--r--4.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/4.py b/4.py
index eeb929e..0d44156 100644
--- a/4.py
+++ b/4.py
@@ -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