DoukutsuNikki/src/Random.cpp

16 lines
243 B
C++
Raw Permalink Normal View History

2022-11-03 06:29:20 +00:00
#include "Random.h"
// A replication of MSVC's rand algorithm
static unsigned long next = 1;
int msvc_rand(void)
{
next = ((next) * 214013 + 2531011);
return ((next) >> 16) & 0x7FFF;
}
void msvc_srand(unsigned int seed)
{
next = seed;
}