import random


def _generate_indices_list(terrain):
    """
    Returns a unordered list of valid coordinates for given terrain.

    :param terrain: The terrain to find coordinates for.
    :returns: A scrambled list of indices

    """
    # Create list of ordered indices
    indices = []

    # For each row...
    for i in range(len(terrain)):
        # For each column...
        for j in range(len(terrain[i])):
            indices.append((i, j))

    # Scramble indices
    random.shuffle(indices)

    # Return scrambled list of indices
    return indices