check for horizontal/vertical bingos

This commit is contained in:
Josh Holtrop 2016-04-14 17:57:17 -04:00
parent 0c22ac8a45
commit 97b3bb42da

View File

@ -30,3 +30,15 @@ class Board:
for row in range(5):
if self.cols[col][row] == n:
self.called[col][row] = True
def has_bingo(self):
for i in range(5):
all_col = True
all_row = True
for j in range(5):
if not self.called[i][j]:
all_col = False
if not self.called[j][i]:
all_row = False
if all_col or all_row:
return True