def round_robin(
        num_tasks,
        num_resources,
        verbose=False):
    """Round-Robin scheduling algorithm.

    Parameters
    ----------
    num_tasks : int
        Number of tasks
    num_resources : int
        Number of resources
    verbose : bool [default=False]
        True if messages should be printed during scheduling

    Returns
    -------
    list of int
        Mapping of tasks to resources

    Notes
    -----
    A round-robin algorithm takes tasks in [lexicographical] order and
    maps them to a list of resources.
    The first task is mapped to the first resource.
    The second task is mapped to the second resource.
    When the list of resources is exhausted, we start again taking resources
    from the start.
    """
    if verbose:
        print(f'Round-Robin: starting with {num_tasks} tasks' +
              f' and {num_resources} resources.')
    # Empty mapping
    mapping = [None] * num_tasks

    # Iterates mapping tasks to resources in order
    for task in range(num_tasks):
        resource = task % num_resources
        mapping[task] = resource
        if verbose:
            print(f'- Mapping task {task} to resource {resource}')

    return mapping