If you look at line 12 I need to make a restriction so that you can not overlap each other. (for example I don’t want "X" to go on a spot where "O" already is. (And yes I have to use a while loop) I have tried different ways but it does not seem to […]
Categories
Tic Tac Toe game using python [closed]
- Post author By Full Stack
- Post date March 4, 2021
- No Comments on Tic Tac Toe game using python [closed]
- Tags "|", 2, 3, 3): print(board[i], 4, 5, 6, 7, 8, 9, 9] playerturn="X" while True: for i in range(0, board[i+1], board[i+2]) if (i<6): print("------------") choose=int(input("Where do you want to play your" + " " + playerturn + ":")), board[i+2]) if (i<6): print("------------") I want to reduce this code above so that I am not just repasting it in each if statement ^, board[i+2]) if (i<6): print("------------") winner=board[0] print("The winner is", board[i+2]) if (i<6): print("------------") winner=board[3] print("The winner is", board[i+2]) if (i<6): print("------------") winner=board[6] print("The winner is", If you look at line 12 I need to make a restriction so that you can not overlap each other. (for example I don't want "X" to go on a spot whe, winner) break elif (board[0]==board[3]) and (board[3]==board[6]): for i in range(0, winner) break elif (board[3]==board[4]) and (board[4]==board[5]): for i in range(0, winner) break elif (board[6]==board[7]) and (board[7]==board[8]): for i in range(0