mardi 19 avril 2022

How to give an array more chance based on its length?

I had these two data1 and data2 arrays which were going to get updated based on the different types of data they received (two different languages here).

After receiving enough data, I wanted my code to use the data inside one of the arrays randomly, but the chance of one getting selected had to change based on the amount of data they had stored. The more the data, the higher the probability.




Aucun commentaire:

Enregistrer un commentaire