samedi 10 janvier 2015

Generating the same random number?

How can I generate a random number that is the same depending on the x, y, and seed values? So if you kept choosing the exact same values for x, y, and seed, it would always return the same float from 0.0 to 1.0. Something like:



//Returns value from 0.0 to 1.0
public static float random(int seed, int x, int y) {
...
return rand;
}


*Without using new Random()





Aucun commentaire:

Enregistrer un commentaire