I want a variable that generates a random number from .1 to 1. Within a function i want to refer to that variable several times each reference should generate a unique number… If that ramble makes sense. There have been things that glance on it but usually in C or some other language. I need this in javascript.
var randoms = Math.floor(Math.random() * 1) + .15;
I have this code here, I reference it within the same function about 15 times. Each of those times I want the number to be different. As it stands this generates one unique number that then gets used 15 times.
I know it must be simple as it is a simple a concept, yet I cannot wrap my mind around it.
some guidance would be amazing.
Aucun commentaire:
Enregistrer un commentaire