Skip to content

Instantly share code, notes, and snippets.

View gist:56751210439737ffb54d71b06cd65ea3
# 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*****')