do you know a way to split an integer into say… 5 groups.
Each group total must be at random but the total of them must equal a fixed number.
for example I have “100” I wanna split this number into
1- 20
2- 3
3- 34
4- 15
5- 18
EDIT: i forgot to say that yes a balance would be a good thing.I suppose this could be done by making a if statement blocking any number above 30 instance.
Depending on how random you need it to be and how resource rich is the environment you plan to run the script, you might try the following approach.
The example of generated result, will look something like this. Pretty random.