uint16_t rrand() {
// Pseudo-random number generator (LGC algorithm). Use instead of rand() to ensure portable predictability.
uint32_t a = 1103515245; // Values for a and b as recommended by POSIX.1-2001 (see man page rand(3)).
uint16_t b = 12345;
uint32_t mod = 2147483648;
uint16_t rrand() {
// Pseudo-random number generator (LGC algorithm). Use instead of rand() to ensure portable predictability.
uint32_t a = 1103515245; // Values for a and b as recommended by POSIX.1-2001 (see man page rand(3)).
uint16_t b = 12345;
uint32_t mod = 2147483648;