examples/naughts_and_crosses.py
def play():
    'Play a game of naughts and crosses against the computer.'
    ai = {'X': player_move, 'O': random_move}
    board = Board()
    while not board.winner:
        x, y = ai[board.player](board)
        board = board.make_move(x, y)
    print(board, end='\n\n')
    print(board.winner)
def play():
    'Play a game of naughts and crosses against the computer.'
    ai = {'X': player_move, 'O': random_move}
    board = Board()
    while not board.winner:
        x, y = ai[board.player](board)
        board = board.make_move(x, y)
    print(board, end='\n\n')
    print(board.winner)
def play ( ) : ai = { 'X' : player_move , 'O' : random_move } board = Board ( ) while not board . winner : x , y = ai [ board . player ] ( board ) board = board . make_move ( x , y ) print ( board , end = '\n\n' ) print ( board . winner )
Play a game of naughts and crosses against the computer.
Play a game of naughts and crosses against the computer .