Fix find-four exploit

Prevent users from being able to take already occupied slots on row 5
This commit is contained in:
ctx256 2022-08-08 15:05:29 +03:00 committed by ctx256
parent a2999ad485
commit 509856a3af

View File

@ -13,7 +13,7 @@ class ConnectFourLogic(ITable):
def is_valid_move(self, col, row):
if 0 <= row <= 5 and 0 <= col <= 6:
if row == 5 or (self.board[col][row] == 0 and self.board[col][row + 1]):
if (row == 5 or self.board[col][row + 1]) and self.board[col][row] == 0:
return True
return False