Page 1 of 1

Ich möchte Option Choice Player in Tic TAC Game Python [geschlossen] machen

Posted: 06 Feb 2025, 08:58
by Anonymous
Hallo allerseits, sie möchte Option Choice Player in meinem TIC TAC Toe x/o
machen

Code: Select all

import random

board = ["-", "-", "-",
"-", "-", "-",
"-", "-", "-"]
curretPlayer="X"
Winner = None
gameRunning = True

# printing the game board
def printBoard(board):
print(board[0] + " | " + board[1] + " | " + board[2])
print(8*"-")
print(board[3] + " | " + board[4] + " | " + board[5])
print(8*"-")
print(board[6] + " | " + board[7] + " | " + board[8])
printBoard(board)

# take player input
def playerInput(board):
inp = int(input("Enter a number 1-9: "))
if inp >= 1 and inp