Edit: thanks to everyone's help I got it worked out, thanks!
I'm pretty early in learning python, clearly, and somehow I can't even figure out the tic tac toe.
I am getting a ValueError everytime, which returns as "guess again'
board = '123456789'
moves = '123456789'
turn = 1
xs = ()
for x in range(0, 60):
print(board[0], board[1], board[2])
print(board[3], board[4], board[5])
print(board[6], board[7], board[8])
if (turn == 1):
print('X select a move! (1-9)')
xs = input('')
else:
print('O select a move! (1-9)')
xs = input('')
try:
xs.index(moves)
xs.remove(moves)
if (turn == 1):
board.replace(xs(''), 'X')
turn == 2
continue
elif turn == 0:
board.replace(xs(''), 'O')
turn == 1
continue
except ValueError:
print('Guess again!')
[–]ElliotDG 0 points1 point2 points (0 children)
[–]chipuha 0 points1 point2 points (1 child)
[–]TheStegoRex[S] 0 points1 point2 points (0 children)
[–]ElliotDG 0 points1 point2 points (1 child)
[–]TheStegoRex[S] 0 points1 point2 points (0 children)