vendredi 20 janvier 2017

How to generate a non-repetitive sequence of random numbers using std::rand

Reading std::uniform_int_distribution in the final example the generated sequence is:

1 1 6 5 2 2 5 5 6 2

How can I guarantee that all the generated numbers are different between them? And if this is possible, what is the expected behavior if we generate more numbers than the ranger size?




Aucun commentaire:

Enregistrer un commentaire