Computer Chess Club Archives


Search

Terms

Messages

Subject: How to create a set of random integers for hashing?

Author: Ed Schröder

Date: 02:46:50 10/18/98


Since ages I use the following formula for creating a set of random
integers for hashing at program start:

#define LENGTH 64*12

int random [LENGTH];

int a,b,c,d,x;

srand(9);                    // initialize prime number

for (x=0; x<LENGTGH; x++)
 { a=rand(); b=rand(); if (b & 1) a=a | 0x8000;
   c=rand(); d=rand(); if (d & 1) c=c | 0x8000;
   random[x]=(a<<16)+c;
 }

I wonder how good such a system is and how others do it.

- Ed -




This page took 0.06 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.