def walk_line(strings, max_x, max_y, coordinates, direction, path_char):
    """
    Given some starting points and a direction, find any connected corners in said direction.

    :param strings string - the text that may contain rectangles.
    :param max_x int - the boundary/width of the text.
    :param max_y int - the boundary/height of the text.
    :param coordinates list[(tuple),...] - List containing starting locations (y, x).
    :param direction string - "+" or "-" for incrementing/decrmenting x or y depending on path_char.
    :param path_char string - "|" or "-" the connecting char to look for.
    :return list[(tuple),...] - List containing any valid corners in the direction specified.
    """
    corner_coords = []
    for coords in coordinates:
        y = coords[0]
        x = coords[1]

        in_bounds = True
        while (in_bounds):
            # move 'forward'
            if path_char == "-" and direction == "+":
                x += 1
            elif path_char == "-" and direction == "-":
                x -= 1
            elif path_char == "|" and direction == "+":
                y += 1
            elif path_char == "|" and direction == "-":
                y -= 1

            if x < 0 or x > max_x or y < 0 or y > max_y:
                in_bounds = False
                break

            if strings[y][x] == path_char:
                continue
            elif strings[y][x] == "+":
                corner_coords.append((y, x))
            else:
                break

    return corner_coords