Random class is a very fast pseudo-random number generator, which can generate integers between 1 and 2G-2 continuously and without repetition.
Random(); explicit Random(uint32_t seed);
- The default constructor uses 1 as the seed number, and the second constructor uses the parameter seed as the seed number.
Returns the next pseudo-random number, not thread safe. Once the seed number is determined, the random sequence generated by calling next() is completely determined.
Random r(7); int n = r.next();