from Mapa.shelf import Shelf from wheel import Wheel from Mapa.box import Box import random def randomBox(data, mapa_, regals_, ile): regals = regals_ mapa = mapa_ tupleList = [] ileRegalow = len(regals) iteration = 0 while iteration < ileRegalow and iteration < ile: regal = random.choice(regals) if regal in tupleList: continue else: tupleList.append(regal) iteration+=1 for (i,j,x) in tupleList: box = Box() mapa[i][j].put(box) data.zajeteRegaly = tupleList return mapa