12/14/2023 0 Comments My 4.5 yr old doesnt get tic tac toe![]() (board and board and board = mark) or # Diagonals (board and board and board = mark) or # Columns Return ((board and board and board = mark) or # Rows ![]() Marker = input('Player1: Choose X or O: ').upper()ĭef place_marker(board, marker, position): # Allows player to place their marker at specific board indexĭef win_check(board, mark): # Check all rows, columns, diagonals for sharing the same marker to check for a winner Print(board + '|' + board + '|' + board)ĭef player_input(): # Player assignment - use while loop to keep asking until a valid character is entered I have tried to debug but the code is syntactically valid so I cannot pinpoint the logical issues with it. Additionally, the player that does move, whenever they choose a spot on the top row (indexes 7-9), it is an automatic win. It randomly assigns which player will go first, which it's supposed to, but that player's marker is not assigned correctly and the other player never gets to move. I have followed the steps exactly but I think the game was written specifically for a Jupyter notebook because it is not working properly for me in a real python interpreter (I wrote out all the code in VS code). I did a code-along for a tic-tac-toe game written in python.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |