There is a code snippet turnset = False in line 14 that displayed as invalid syntax but an exact replica is in line 5 and works fine!
Code here:
X = "X"
O = "O"
w = "none"
board = [N, N, N, N, N, N, N, N, N]
win = False
turn = input("Player 1 first?")
p1 = input("Player 1:")
p2 = input("Player 2:")
print(" ")
for turns in range (9
if (turn)
turn = False
print(p1 + "'s turn!")
x = input("X coordinates:")
y = input("Y coordinates:")
pos = (y - 1) * 3 + x - 1
board[pos] = X
else:
turn = True
if False:
print(p2 + "'s turn!")
x = input("X coordinates:")
y = input("Y coordinates:")
pos = (y - 1) * 3 + x - 1
board[pos] = O
print(board[0] + board[1] + board[2])
print(board[3] + board[4] + board[5])
print(board[6] + board[7] + board[8])
tile = X
if ((board[0] == tile and board[1] == tile and board[2] == tile) or (board[3] == tile and board[4] == tile and board[5] == tile) or (board[6] == tile and board[7] == tile and board[8] == tile) or ((board[0] == tile and board[3] == tile and board[6] == tile) or (board[1] == tile and board[4] == tile and board[7] == tile) or (board[2] == tile and board[5] == tile and board[8] == tile) or ((board[0] == tile and board[4] == tile and board[8] == tile) or (board[2] == tile and board[4] == tile and board[6] == tile))
w = p1
break
tile = O
if ((board[0] == tile and board[1] == tile and board[2] == tile) or (board[3] == tile and board[4] == tile and board[5] == tile) or (board[6] == tile and board[7] == tile and board[8] == tile) or ((board[0] == tile and board[3] == tile and board[6] == tile) or (board[1] == tile and board[4] == tile and board[7] == tile) or (board[2] == tile and board[5] == tile and board[8] == tile) or ((board[0] == tile and board[4] == tile and board[8] == tile) or (board[2] == tile and board[4] == tile and board[6] == tile))
w = p2
break
if (w != "none")
print(w + "won!")
else
print("Tie!")
for turns in range (9is correct? Hint #2: it's not.