diff options
Diffstat (limited to 'CPP/Common/Random.cpp')
-rwxr-xr-x | CPP/Common/Random.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/CPP/Common/Random.cpp b/CPP/Common/Random.cpp new file mode 100755 index 00000000..f4a629c2 --- /dev/null +++ b/CPP/Common/Random.cpp @@ -0,0 +1,17 @@ +// Common/Random.cpp + +#include "StdAfx.h" + +#include <time.h> +#include <stdlib.h> + +#include "Common/Random.h" + +void CRandom::Init(unsigned int seed) + { srand(seed); } + +void CRandom::Init() + { Init((unsigned int)time(NULL)); } + +int CRandom::Generate() const + { return rand(); } |