I am just trying to code a very simple tictactoe. the variable titled ‘one’ in the function called updategrid is the one giving me trouble.
gamestate = "playing"
playerturn = "x"
one = "1"
two = "2"
three = "3"
four = "4"
five = "5"
six = "6"
seven = "7"
eight = "8"
nine = "9"
def showgrid():
print(f'{one}|{two}|{three}')
print("_____")
print(f'{four}|{five}|{six}')
print("_____")
print(f'{seven}|{eight}|{nine}')
def updategrid():
if playerinput == "1":
one = playerturn
while gamestate == "playing":
if playerturn == "x":
showgrid()
playerinput = input("which place would you like to go in")
updategrid()