from typing import Sequence
import random


def _random_walk(length: int, max_step_length: int) -> Sequence[int]:
    """Return a list of values that rise and fall randomly."""
    output = []
    pos = 0
    for _ in range(length):
        pos += random.randint(-max_step_length, max_step_length)
        output.append(pos)
    return output