📜  防止玩家在 python tic tac toe 游戏中进入同一块 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:06.189000             🧑  作者: Mango

代码示例1
def space_check(board, position):
    return board[position] == '#'
def player_choice(board):
    choice = input("Please select an empty space between 1 and 9 : ")
    while not space_check(board, int(choice)):
        choice = input("This space isn't free. Please choose between 1 and 9 : ")
    return choice