def netInputIndex(s, current, x, y):
    """
    Helper function for gameToNetInput. Get the index of the list to update
    :param s: The piece at the position being looked at
    :param current: The currently selected piece, None if no piece is selected
    :param x: The x coordinate of the position being looked at
    :param y: The y coordinate of the position being looked at
    :return: The index of the list where this piece will be placed in the net input
    """
    # if the piece is an ally
    if s[0]:
        # if the piece is the one selected by Environment
        if current is not None and (x, y) == current:
            return 5 if s[1] else 4
        # if it's a normal piece
        else:
            return 1 if s[1] else 0
    else:
        return 3 if s[1] else 2