@staticmethod
    def parse_input(legal_moves, input):
        """ Verifies that the move is in the list of moves. Returns either a
        valid move or None if the move is invalid. """
        # verify length
        if len(input) == 2:
            xc = input[0]
            yc = input[1]

            # validate range
            if xc>='a' and xc <='h' and yc>='1' and yc <='8':
                x = ord(xc)-ord('a') # convert letter to number from 0 to 7
                y = int(yc)-1        # convert numeral to int from 0 to 7
    
                # create the move
                move = (x,y)
    
                # validate legality
                if move in legal_moves:
                    return move 
                else:
                    return None
dataset/ETHPy150Open JaimieMurdock/othello/othello/engines/human.py/HumanEngine.parse_input/original