29 Point p =
Point(rand() - 16384, rand() - 16384, 0);
38 Point p =
Point(rand() - 16384, rand() - 16384, 0);
48 Vec3 v =
Vec3(rand() - 16384, rand() - 16384, rand() - 16384);
54 v *= (float)
Random(radius/3, radius);
61 double Random(
double min,
double max)
63 double delta = max - min;
64 double r = delta * rand() / 32768.0;
74 static int table[16] = { 0, 9, 4, 7, 14, 11, 2, 12, 1, 5, 13, 8, 6, 10, 3, 15 };
76 int r = 1 + ((rand() & 0x0700) >> 8);
78 if (index > 1e7) index = 0;
79 return table[index % 16];
86 double fraction = 256.0 * wins / tries;
87 double r = (rand() >> 4) & 0xFF;
97 int step = (int)
Random(1, range-1);
98 return (current + step) % range;
108 static int set_size = -1;
109 static BYTE
set[256];
110 static int index = -1;
112 if (count < 0 || count > 250)
115 if (set_size != count) {
121 if (index < 0 || index > set_size-1) {
124 for (
int i = 0; i < 256; i++)
128 for (
int i = 0; i < set_size; i++) {
129 int n = (int)
Random(0, set_size);
130 int tries = set_size;
131 while (tmp[n] < 0 && tries--) {
132 n = (n+1) % set_size;