game.py
def threefold_repetition(self):
        """Return True if and only if the current position has occured 2 times
        earlier. Positions are considered the same if the same player has the move,
        pieces of the same kind and color occupy the same squares, and the
        possible moves of all the pieces of both players are the same.
        This is the case if the FEN strings of the positions have the same
        first four fields.
        """
        # Produce a string that contain the first four fields in the current
        # FEN string.
        FEN_fields = self.FEN_string.split(" ")
        partial_FEN_string = " ".join([FEN_fields[n] for n in range(4)])

        # Look for that strings in the history list that contain that string as a
        # substring.
        repeat = 0
        for FEN_string in self.FEN_string_history:
            if partial_FEN_string in FEN_string:
                repeat += 1
        return repeat >= 2
Return True if and only if the current position has occured 2 times
        earlier. Positions are considered the same if the same player has the move,
        pieces of the same kind and color occupy the same squares, and the
        possible moves of all the pieces of both players are the same.
        This is the case if the FEN strings of the positions have the same
        first four fields.
        
Return True if and only if the current position has occured 2 times
earlier. Positions are considered the same if the same player has the move,
pieces of the same kind and color occupy the same squares, and the
possible moves of all the pieces of both players are the same.
This is the case if the FEN strings of the positions have the same
first four fields.
Return True if and only if the current position has occured 2 times earlier . Positions are considered the same if the same player has the move pieces of the same kind and color occupy the same squares and the possible moves of all the pieces of both players are the same . This is the case if the FEN strings of the positions have the same first four fields .
def threefold_repetition(self):
        FEN_fields = self.FEN_string.split(" ")
        partial_FEN_string = " ".join([FEN_fields[n] for n in range(4)])
        repeat = 0
        for FEN_string in self.FEN_string_history:
            if partial_FEN_string in FEN_string:
                repeat += 1
        return repeat >= 2
def threefold_repetition ( self ) : FEN_fields = self . FEN_string . split ( " " ) partial_FEN_string = " " . join ( [ FEN_fields [ n ] for n in range ( 4 ) ] ) repeat = 0 for FEN_string in self . FEN_string_history : if partial_FEN_string in FEN_string : repeat += 1 return repeat >= 2
Return True if and only if the current position has occured 2 times
earlier.
Return True if and only if the current position has occured 2 times earlier .
"""Return True if and only if the current position has occured 2 times
        earlier. Positions are considered the same if the same player has the move,
        pieces of the same kind and color occupy the same squares, and the
        possible moves of all the pieces of both players are the same.
        This is the case if the FEN strings of the positions have the same
        first four fields.
        """ # Produce a string that contain the first four fields in the current # FEN string. # Look for that strings in the history list that contain that string as a # substring.
self