lundi 5 décembre 2022

What is the use of the word "seed" in "Random random = new Random(SEED)"? [duplicate]

I have a question, I don't understand what is the use (what is it practically doing) of the word "seed" in a code of this type:

Random random = new Random(SEED)

I have found this explication on the web:

A seed is a number or a vector assigned to a pseudo-random generator to produce the required sequence of random values. If we pass the same seed, it will generate the same sequence. We usually assign the seed as system time. This way, it will produce a different sequence every time.

https://www.delftstack.com/howto/java/set-random-seed-in-java/

I don't really understand it (and no example is provided).




Aucun commentaire:

Enregistrer un commentaire