Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Random.cpp « Common « CPP - github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9519987eddd7bbac5c90370e99c543cbc7fabe8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Common/Random.cpp

#include "StdAfx.h"

#include <time.h>
#include <stdlib.h>

#include "Random.h"

void CRandom::Init(unsigned int seed)
  { srand(seed); }

void CRandom::Init()
  { Init((unsigned int)time(NULL)); }

int CRandom::Generate() const
  { return rand(); }