board = [['.', '.', '.'], ['.', '.', '.'], ['.', '.', '.']]
pieces = ['X', 'O']
movetype = [0, 1, 2]
turn = 0
breakgame = 0
def movecheck():
if x in movetype:
if y in movetype:
if board[x][y] in pieces:
print 'Invalid move!'
else:
board[x][y] = pieces[turn]
turncheck()
else:
print 'Invalid move!'
else:
print 'Invalid move!'
def turncheck():
global turn
if turn == 0:
turn = 1
else:
turn = 0
while True:
move = raw_input('Player '+str(turn+1)+' ('+pieces[turn]+'): ').split()
x = int(move[0])
y = int(move[1])
movecheck()
if breakgame == 1:
break
for i in board:
' '.join(i)
print i
How do I write a check to see if the player has won?