def gameplay(players):
        '''Provides turn system for a Tic Tac Toe Game.'''

        if 'comp' not in players:
            print('Beginning Game, {} vs {}'.format(players['play1'].getName(),players['play2'].getName()))
        else:
            print('Beginning Game, {} vs the Computer'.format(players['play1'].getName()))
        print("Win Two Matches In a Row to Be Victorious")
        
        board = ticBoard(mode='blank')
        
        turnList = list(players.keys())
        firstTurn = random.choice(turnList)
        #firstTurn = 'comp'
        turn = firstTurn
        selected = []

        while True:
            board.draw()
            if turn != 'comp':
                print(players[turn].getName(),'please select a space.')
                selection = str(input('Space: ')).upper()
                if not d.active or selection not in ["RESET", "END"]:
                    errorCheck = board.checkEntry(selection,selected)
                    while not errorCheck['valid']:
                        errorMessage = errorCheck['message'].format(selection)
                        print(errorMessage)
                        print(players[turn].getName(),'please select a space.')
                        selection = str(input('Space: ')).upper()
                        errorCheck = board.checkEntry(selection,selected)
                if selection == 'END':
                    break
                
            else:
                print('Computer Turn')
                selection = players['comp'].think(board)
                errorCheck = board.checkEntry(selection,selected)
                print('Computer Chooses {}'.format(selection))
                
            if selection != 'RESET' or not d.active:
                board.place(players[turn].getSymbol(), errorCheck['entry'])
                selected.append(selection)
            
            if board.checkWin() and selection != 'RESET':
                board.draw()
                selected = []
                winner = turn
                loser = nextTurn(turnList, turn)
                if players[winner].getMatches() == 1:
                    print(players[turn].getName(),end=' ')
                    str(input('wins!'))
                    players[turn].win()
                    players[loser].resetMatch()
                    players[winner].resetMatch()
                    break #END GAME
                elif players[winner].getMatches() == 0:
                    print(players[turn].getName(),end=' ')
                    players[winner].matchWin()
                    players[loser].resetMatch()
                    str(input('won a match! Beginning next round.'))
                    if 'comp' in players:
                       players['comp'].clearStrategy() 
                    board.clear()
                    turn = loser
                    firstTurn = loser
                
            else:
                if len(board.blankSpaces()) == 0 or selection == 'RESET':
                    board.draw()
                    str(input('Draw! Beginning next round.'))
                    if 'comp' in players:
                       players['comp'].clearStrategy() 
                    players[turn].resetMatch()
                    players[nextTurn(turnList, turn)].resetMatch()
                    board.clear()
                    firstTurn = nextTurn(turnList, firstTurn)
                    turn = firstTurn
                    selected = []
                else:
                    turn = nextTurn(turnList, turn)
                
        try: 
            print()
            print('\t\tCurrent Score\n')
            print('\t'+players[winner].getName()+'\t\t\t'+str(players[winner].getScore()))
            print('\t'+players[loser].getName()+'\t\t\t'+str(players[loser].getScore()))
            print('\n==========================================\n')
        except:
            print('\tNo Scores to Show.\n')

        return players
Provides turn system for a Tic Tac Toe Game.
recipes/Python/580723_TicTacToe_text_based/recipe-580723.py