def index_mark(i, n):
    """Represent relative index as a character."""
    empty, first, last, error = '-', '•', '◘', '!'
    marks = '▁▂▃▄▅▆▇█'
    if len(n) == 0:
        return empty
    if i == 0:
        return first
    if i == len(n) - 1:
        return last
    if i < 0 or i > len(n):
        return error
    return marks[int(i / len(n) * len(marks))]