examples/naughts_and_crosses.py
def winner(self):
        'The winner of this board if one exists.'
        for potential_win in self._potential_wins():
            if potential_win == tuple('XXX'):
                return Outcome.win_for_crosses
            elif potential_win == tuple('OOO'):
                return Outcome.win_for_naughts
        if self._count(' ') == 0:
            return Outcome.draw
        return Outcome.ongoing
def winner(self):
        'The winner of this board if one exists.'
        for potential_win in self._potential_wins():
            if potential_win == tuple('XXX'):
                return Outcome.win_for_crosses
            elif potential_win == tuple('OOO'):
                return Outcome.win_for_naughts
        if self._count(' ') == 0:
            return Outcome.draw
        return Outcome.ongoing
def winner ( self ) : for potential_win in self . _potential_wins ( ) : if potential_win == tuple ( 'XXX' ) : return Outcome . win_for_crosses elif potential_win == tuple ( 'OOO' ) : return Outcome . win_for_naughts if self . _count ( ' ' ) == 0 : return Outcome . draw return Outcome . ongoing
The winner of this board if one exists.
The winner of this board if one exists .