[an error occurred while processing this directive]
|
Вот стандартный алгоритм равномерного распределения. На асм перевести несложно ведь?
#include #define MULTIPLIER 0x015a4e35L The generator is reinitialized by calling srand with an
E-mail:
info@telesys.ru
#define INCREMENT 1
/*
Description rand uses a multiplicative congruential random number
generator with period 2^32 to return successive pseudo-
random numbers in the range from 0 to 2^15 - 1.
argument value of 1. It can be set to a new starting point by
calling srand with a given seed number.
*/
static long Seed = 1;
int rand(void)
{
Seed = MULTIPLIER * Seed + INCREMENT;
return((int)(Seed >> 16) & 0x7fff);
}
Ответы