I just started coding recently and I'm trying to make a Tic Tac Toe program in Python 3. This is the largest project I've attempted yet and I seemed to be doing fine but I ran into a problem that I cannot figure out.
I have my board numbered 1 through 9. When I run this function with arguments move1 and user1 it should change the respective spot on the board to the User's character X or O.
print("Player 1 goes first. Select your square")
move1 = input("> ")
def new_move(number_of_moves, user):
if number_of_moves == '1':
square1 = user
if number_of_moves == '2':
square2 = user
if number_of_moves == '3':
square3 = user
if number_of_moves == '4':
square4 = user
if number_of_moves == '5':
square5 = user
if number_of_moves == '6':
square6 = user
if number_of_moves == '7':
square7 = user
if number_of_moves == '8':
square8 = user
if number_of_moves == '9':
square9 = user
new_move(move1, user1)
tictactoe()
However when I run the function it doesn't change the value of the respective square to the User's character. It doesn't change anything at all. I've been banging my head on the wall trying to figure out why to no avail. Like I said I'm very new to this so any help is appreciated. Thank you!