Skip to content

Commit a926270

Browse files
committed
Added res folder with random seed file containing 10k unique&randomly distributed seeds (full 64 bit unsigned int range)
1 parent 8db0892 commit a926270

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

res/rseed.txt

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

res/scale_randorg_set.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <fstream>
2+
3+
/*
4+
Scales range limited set of random seeds to the full range of
5+
unsigned 64 bit integer, which the std rgen expects.
6+
7+
Provide a unique set of 10000 integers between 0 and 42007935
8+
in a text file set1.txt. Format expected as you get it from
9+
random.org without comma delimiters and unordered.
10+
*/
11+
12+
int main() {
13+
using namespace std;
14+
15+
ifstream infile;
16+
ofstream outfile;
17+
infile.open("set1.txt");
18+
outfile.open("set1_out.txt");
19+
20+
uint_fast64_t factor = 65537;
21+
factor *= 6700417;
22+
for (int i=0; i<10000; ++i) {
23+
uint_fast64_t seed;
24+
infile >> seed;
25+
seed *= factor;
26+
outfile << seed;
27+
outfile << " ";
28+
}
29+
infile.close();
30+
outfile.close();
31+
32+
return 0;
33+
}

0 commit comments

Comments
 (0)