home · contact · privacy
More consistent code styling whitespace rules.
[plomrogue] / src / rrand.h
1 /* rrand.h
2  *
3  * Provide pseudo-random numbers via a Linear Congruential Generator algorithm
4  * with some proven constants. Use these functions instead of rand() and
5  * srand() to ensure portable pseudo-randomness portability.
6  */
7
8 #ifndef RRAND_H
9 #define RRAND_H
10
11 #include <stdint.h>    /* for uint32_t */
12
13
14
15 /* Return 16-bit number pseudo-randomly generated. */
16 extern uint16_t rrand();
17
18 /* Set seed that rrand() starts from. */
19 extern void rrand_seed(uint32_t new_seed);
20
21
22
23 #endif