// a smol Lehmer random number generator #include #include uint8_t lrngsmol(uint8_t *state, uint8_t m, uint8_t a) { return *state = (uint16_t) *state * a % m; } int main(void) { for (uint8_t seed = 0; seed < 32; seed++) { printf("seed %u -", seed); uint8_t state = seed; for (size_t i = 0; i < 8; ++i) { printf(" %u", lrngsmol(&state, 32, 7)); } putchar('\n'); } }