samedi 4 juin 2022

Can't distribute items between arrays

Imagine you have a list of objects. Each object looks like:

{'itemName':'name',
 'totalItemAppearance':100,
 'appearancePerList': 20}

and some number X which stands for number of lists that can contain such items.

What i need to do is randomly picking an item put them into lists with respecting item parameters.

It looks simple but i don't know how to build an algorithm properly and I can't classify the type of "distribution problem" I need for this issue so i could properly ask Google. Thank you for replies!




Aucun commentaire:

Enregistrer un commentaire