0

Normally people use the computer's clock. For example:

int timeSec = time(0)

But I need 4 independent non-repeatable ints, generated pretty much simulateously.

Peter O.
  • 32,158
  • 14
  • 82
  • 96
  • The clock is generally used to seed the random number generator, not as the random number itself. Information on random number generation: https://en.cppreference.com/w/cpp/numeric/random – Retired Ninja Dec 15 '20 at 09:47

1 Answers1

0

You could find it here if you avoid the range and check if your number is not repeated:

Generate random numbers uniformly over an entire range