def defensiveStrategy(self, board):
        '''Provide defensive move based on a certain tactic.'''
        if self.tactic == 'center': #Keep Selecting Corners
            for corner in corners:
                if board.board[corner] == ' ':
                    debug(d,'Get Corners')
                    return {'defense':True, 'entry':corner}
        elif self.tactic == 'corner':
            if board.board['CM'] == ' ': #Get Center
                debug(d,'Secure Center')
                return {'defense':True, 'entry':'CM'}
            else:
                if len(board.blankSpaces()) == 6:
                    cornersFound = 0
                    for corner in corners:
                        if board.board[corner] == 'O':
                            cornersFound += 1
                    if cornersFound == 2:
                        for side in sides:
                            if board.board[side] == ' ':
                                debug(d,'Two Corners')
                                return {'defense':True, 'entry':side}
                    else:
                        self.strategy = 'offensive'
                        self.tactic = 'center'
                        self.reiterate = True
                        debug(d,'Retrategizing')
                        return {'defense':False, 'entry':''}
        elif self.tactic == 'side':
            if board.board['CM'] == ' ': #Get Center
                return {'defense':True, 'entry':'CM'}
            else:
                if len(board.blankSpaces()) == 6:
                    report = board.fieldReport()
                    for triad in report:
                        if triad == ('O','X','O'):
                            debug(d,'OXO Kill')
                            return {'defense':True, 'entry':random.choice(corner)}
            
        return {'defense':False, 'entry':''}
Provide defensive move based on a certain tactic.
recipes/Python/580723_TicTacToe_text_based/recipe-580723.py