19 lines
242 B
C
19 lines
242 B
C
|
#include <base.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
#ifndef __RNG_H__
|
||
|
#define __RNG_H__
|
||
|
|
||
|
typedef struct RNG {
|
||
|
uint8_t mod;
|
||
|
int8_t a;
|
||
|
int8_t c;
|
||
|
uint8_t seed;
|
||
|
} rng_t;
|
||
|
|
||
|
rng_t rng_new(uint8_t seed);
|
||
|
|
||
|
uint8_t rng_sample(rng_t *state);
|
||
|
|
||
|
#endif
|