tictactoe loop error
I started to write a very simple tic tac toe game, to see how far I get. I wrote a piece of code for player 1 to make a move. It works as it should, except when I try to make a loop out of it to be able to make multiple moves. Then I get a traceback error after the first move. What did I do wrong? ----------------------------- board = ["_", "_", "_", "_", "_", "_", "_", "_", "_"] boardmove = {"A1": 0, "B1": 1, "C1": 2, "A2": 3, "B2": 4, "C2": 5, "A3": 6, "B3": 7, "C3": 8} movenumber = 9 user1_move = "" user2_move = "" def move1(user1_move): #input move print("Player 1: make a move") user1_move = input() if "A" not in user1_move and "B" not in user1_move and "C" not in user1_move: print("This is not a valid move") elif "1" not in user1_move and "2" not in user1_move and "3" not in user1_move: print("This is not a valid move") else: #replace chosen field with X board[boardmove.get(user1_move)] = "X" #print new board situation print(" A B C") print("") print("1 " + str(board[:3])) print("") print("2 " + str(board[3:6])) print("") print("3 " + str(board[6:])) print("") while movenumber > 0: move1(user1_move) movenumber -= 1