check for horizontal/vertical bingos
This commit is contained in:
parent
0c22ac8a45
commit
97b3bb42da
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user