0
I am programming TicTacToe, but i need the last turn from the last playing player. I wrote it like this:
turn_1 = input("...") turn1 = turn_1 TicTacTo() #the conditions, where i need the last turn (turn1)
3 Réponses
+ 2
If you want python to take a user input and then store it, use...
input = input()
You now have a string that the user inputted stored in the variable input.
Now, you can do some 'if' tests to see what the user wants to do, using something like...
if input == "5":
#Place X on square five
Sorry if this is not what you wanted :P I can misinterpret these things.
+ 1
woahhhh never attribute a variable to another unless you need to change it later on.
like if you want to permute variable a=1 and variable b=2 you could use a variable c:
c=b
b=a
a=c
.......
(or you could just use a,b=b,a)
i'm talking about your second line in your program btw ..
0
sorry mate, but I don't think tic tac toe is the right thing for you to do at the moment.. try something easier, like rock paper scissors