Random2Class consists of:
int FirstIndex;
int SecondIndex;
int NumberArray[249];
The constructor sets FirstIndex to 0, SecondIndex to 103 and fills NumberArray with random numbers from Random3Class::operator().
Random2Class::operator() works like:
int Ret = NumberArray[SecondIndex] ^ NumberArray[FirstIndex];
NumberArray[FirstIndex] = Ret;
FirstIndex++;
SecondIndex++;
if (FirstIndex > 249)
{ FirstIndex = 0; }
if (SecondIndex > 249)
{ SecondIndex = 0; }
return Ret;
}
And Get_Random_Int() works like:
int __cdecl Get_Random_Int(int Low, int High)
{
RealLow = Low;
RealHigh = High;
if ( Low > High )
{
RealLow = High;
RealHigh = Low;
}
return RealLow + (Random2Class__operator__(FreeRandom) & 0x7FFFFFFF) % (RealHigh - RealLow);
}
[Updated on: Sun, 12 August 2012 15:11]
Report message to a moderator