lundi 6 décembre 2021

Javascript method to generate

Let's say there are 100 people, and $120, is what kind of formula, could divide it into random amounts to where each person gets something?

In this scenario, one person could get an arbitrary amount like $0.25, someone can get $10, someone can get $1, but everyone gets something. Any tips?

So in javascript, an array of 100 could be generated, and these random numbers would be in them, but they would add up to 100




Aucun commentaire:

Enregistrer un commentaire