def lincr(l,cap):        # to increment a list up to a max-list of 'cap'
    l[0] = l[0] + 1     # e.g., [0,0,0] --> [2,4,3] (=cap)
    for i in range(len(l)):
        if l[i] > cap[i] and i < len(l)-1: # if carryover AND not done
            l[i] = 0
            l[i+1] = l[i+1] + 1
        elif l[i] > cap[i] and i == len(l)-1: # overflow past last column, must be finished
            l = -1
    return l
Link exits between this room (self), and the room passed.
dataset/ETHPy150Open radlab/sparrow/src/main/python/third_party/stats.py/lincr--crossover with--dataset/ETHPy150Open shinymud/ShinyMUD/src/shinymud/models/room.py/Room.link_exits