[Icfp04-discuss] Need help with random function

Franz Fangmeyer icfp at rjinswand.de
Sun Jun 6 17:33:47 EDT 2004


On Sunday 06 June 2004 15:58, Jeroen van den Belt wrote:
> can anybody help with the randomint function
> 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;
> }

Look at the task description: x_i depends on s_{i+4} not on s_i.

good luck

Franz

-- 
You are deeply attached to your friends and acquaintances.


More information about the Icfp04-discuss mailing list