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, 9 insertions, 0 deletions
diff --git a/stage3/rng.c b/stage3/rng.c
new file mode 100644
index 0000000..a52b449
--- /dev/null
+++ b/stage3/rng.c
@@ -0,0 +1,9 @@
+#include "rng.h"
+
+int rand()
+{
+ static unsigned long int next = 1;
+
+ next = next * 1103515245 + 12345;
+ return (unsigned int) (next/65535) % 32768;
+}