jeudi 15 février 2018

Rig Java's Random.nextInt(1) to be always 0 or 1? [duplicate]

This question already has an answer here:

How can I "rig" Java's rand.nextInt() method to make a string of 0s or 1s? Is this possible? If anyone has found a seed that does this or knows enough about Don Knuth's random number generator to answer, please share

Places I've looked: How Java random generator works?

https://docs.oracle.com/javase/8/docs/api/java/util/Random.html#next-int-




Aucun commentaire:

Enregistrer un commentaire