[Icfp04-discuss] Need help with random function

Jeroen van den Belt jeroen at chessbase.com
Sun Jun 6 16:58:55 EDT 2004


can anybody help with the randomint function


I dont get the values which are written in the task description.

I use this:


static long seed=12345;

int randomint( int n)
{
	long s= seed * 22695477+1;
	int x = (s / 65536)%16384;
	x= x % n;
	seed =s;
	return x;
}


More information about the Icfp04-discuss mailing list