check for diagonal bingos

This commit is contained in:
Josh Holtrop 2016-04-14 21:05:16 -04:00
parent 97b3bb42da
commit ee0339c137

View File

@ -32,6 +32,8 @@ class Board:
self.called[col][row] = True
def has_bingo(self):
all_diag1 = True
all_diag2 = True
for i in range(5):
all_col = True
all_row = True
@ -42,3 +44,10 @@ class Board:
all_row = False
if all_col or all_row:
return True
if not self.called[i][i]:
all_diag1 = False
if not self.called[i][4 - i]:
all_diag2 = False
if all_diag1 or all_diag2:
return True
return False