jeudi 14 février 2019

Is there any way in Java that I can generate a 2D array of characters randomly, the said characters beeing in a certain proportion?

I'm trying to create a randomized 2D array consisting of only 3 characters, say '.', '#' and 'A'. Is there any way that I can generate the array with certain proportions to characters? Let's say 20% '#', 10% 'A' and the rest '.'.




Aucun commentaire:

Enregistrer un commentaire