summaryrefslogtreecommitdiff
path: root/stage3/rng.c
diff options
context:
space:
mode:
Diffstat (limited to 'stage3/rng.c')
-rw-r--r--stage3/rng.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/stage3/rng.c b/stage3/rng.c
index a52b449..01e6597 100644
--- a/stage3/rng.c
+++ b/stage3/rng.c
@@ -1,9 +1,14 @@
#include "rng.h"
+static unsigned long int next = 1;
+
int rand()
{
- static unsigned long int next = 1;
-
next = next * 1103515245 + 12345;
return (unsigned int) (next/65535) % 32768;
}
+
+void srand(int seed)
+{
+ next = seed;
+}