Skip to content

Instantly share code, notes, and snippets.

@rioj7
rioj7 / gist:56751210439737ffb54d71b06cd65ea3
Last active November 24, 2020 09:30
tic-tac-toe board check
# https://stackoverflow.com/questions/64983060/how-can-i-make-this-tic-tac-toe-code-work
# Consider using this function
def checkBoard(board, turn):
winLine = [ (1,2,3), (4,5,6), (7,8,9), (1,4,7), (2,5,8), (3,6,9), (1,5,9), (3,5,7) ]
for p,q,r in winLine:
if board[p] != ' ' and board[p] == board[q] and board[p] == board[r]:
printboard(board)
print("\nGame Over.\n")
print(' *****' + turn + ' vann. yippie*****')