Created
December 19, 2019 10:26
-
-
Save Bouzazi/61b0c952c52de1805fd6a4e18d7e950a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def win_check(board,mark): | |
return ((board[7] == mark and board[8] == mark and board[9] == mark) or # across the top | |
(board[4] == mark and board[5] == mark and board[6] == mark) or # across the middle | |
(board[1] == mark and board[2] == mark and board[3] == mark) or # across the bottom | |
(board[7] == mark and board[4] == mark and board[1] == mark) or # down the middle | |
(board[8] == mark and board[5] == mark and board[2] == mark) or # down the middle | |
(board[9] == mark and board[6] == mark and board[3] == mark) or # down the right side | |
(board[7] == mark and board[5] == mark and board[3] == mark) or # diagonal | |
(board[9] == mark and board[5] == mark and board[1] == mark)) # diagonal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment