Merge pull request #84 from ctx256/master

Fix find-four exploit
This commit is contained in:
AllinolCP 2022-08-08 21:12:54 +07:00 committed by GitHub
commit 29180fe485
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ class ConnectFourLogic(ITable):
def is_valid_move(self, col, row): def is_valid_move(self, col, row):
if 0 <= row <= 5 and 0 <= col <= 6: 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 True
return False return False