Game_letters = # Y: players' names are strings rather than integers, so initial values of corresponding variables should be empty strings I modified your code a bit putting some comments into it. You should move the invocation to the place before the part of the code that carries on the game. Your function main() assigns a letter to the player but its invocation is put at the end of the script (and it is conditional for some reason). If name = ‘ wroteI have created a sentence to assign which player take which letter whether x or oĪnd I have created many statements but they didn’t work If board = board = board = "O": #across the top rowĮlif board = board = board = "O": #across the middle rowĮlif board = board = board = "O": #across the bottom rowĮlif board = board = board = "O": #first columnĮlif board = board = board = "O": #second columnĮlif board = board = board = "O": #third columnĮlif board = board = board = "O": #left diagonalĮlif board = board = board = "O": #right diagonal If board = board = board = "X": #across the top rowĮlif board = board = board = "X": #across the middle rowĮlif board = board = board = "X": #across the bottom rowĮlif board = board = board = "X": #first columnĮlif board = board = board = "X": #second columnĮlif board = board = board = "X": #third columnĮlif board = board = board = "X": #left diagonalĮlif board = board = board = "X": #right diagonal Move_2 = int(input(" Make a move (O): ")) + " take : " + str(this_player)) while True: Print(str(player_1) + " take : " + str(this_player) + str(player_2) Turn = input(“Player " + str(player_1) + " would you like to choose X Player_2 = print("Player 2 please enter your name: ") Player_1 = print("Player 1 please enter your name: ") I’m trying to implement a tic tac toe game project in and in my code I have created a sentence to assign which player take which letter whether x or o and I have created many statements but they didn’t work, kindly if anyone could assist to have a look on my code, I would be grateful.īoard =
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |