summaryrefslogtreecommitdiff
path: root/stage3/rng.c
blob: 01e65978af95addf1ae76bb1c3d624d141bed366 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "rng.h"

static unsigned long int next = 1;

int rand()
{
	next = next * 1103515245 + 12345;
	return (unsigned int) (next/65535) % 32768;
}

void srand(int seed)
{
	next = seed;
}