A random number generator class that wraps FastLED's random functions.
This class provides a standard C++ random generator interface that can be used with algorithms like fl::shuffle. Each instance maintains its own seed state independent of other instances and the global FastLED random state.
A random number generator class that wraps FastLED's random functions.
void shuffle(Iterator first, Iterator last, RandomGenerator &g)
HeapVector< T, Allocator > vector
Definition at line 20 of file random.h.
|
| fl_random () |
| Default constructor - uses current global random seed.
|
|
| fl_random (u16 seed) |
| Constructor with explicit seed.
|
|
void | add_entropy (u16 entropy) |
| Add entropy to this random number generator instance.
|
|
u16 | get_seed () const |
| Get the current seed value for this instance.
|
|
result_type | operator() () |
| Generate a random number.
|
|
result_type | operator() (result_type min, result_type max) |
| Generate a random number in the range [min, max)
|
|
result_type | operator() (result_type n) |
| Generate a random number in the range [0, n)
|
|
u16 | random16 () |
| Generate a 16-bit random number.
|
|
u16 | random16 (u16 min, u16 max) |
| Generate a 16-bit random number in the range [min, max)
|
|
u16 | random16 (u16 n) |
| Generate a 16-bit random number in the range [0, n)
|
|
u8 | random8 () |
| Generate an 8-bit random number.
|
|
u8 | random8 (u8 min, u8 max) |
| Generate an 8-bit random number in the range [min, max)
|
|
u8 | random8 (u8 n) |
| Generate an 8-bit random number in the range [0, n)
|
|
void | set_seed (u16 seed) |
| Set the seed for this random number generator instance.
|
|