samedi 23 janvier 2021

weighted random selection in java?

Can I do the following in java without using external libraries? Maybe with if-else statements? thanks

import random

print(random.choices(['A', 'B', 'C'], [0.5, 0.3, 0.2]))



Aucun commentaire:

Enregistrer un commentaire