-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain-single.cpp
More file actions
47 lines (40 loc) · 1.29 KB
/
main-single.cpp
File metadata and controls
47 lines (40 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "finders.h"
#include "generator.h"
#include <stdio.h>
#include <omp.h>
#include <chrono>
using namespace std::chrono;
int main()
{
int radius = 5;
int structType = Village;
int mc = MC_1_20;
auto start = high_resolution_clock::now();
Generator g;
setupGenerator(&g, mc, 0);
StructureConfig sconf;
getStructureConfig(Village, mc, &sconf);
int region_size = sconf.regionSize;
int size = 5 * region_size;
for (uint64_t seed = 0; seed < (1L<<48L); seed++) {
applySeed(&g, DIM_OVERWORLD, seed);
for (int rx = -radius; rx < radius; rx++) {
for (int rz = -radius; rz < radius; rz++) {
Pos p;
getStructurePos(structType, mc, seed, rx, rz, &p);
if (isViableStructurePos(structType, &g, p.x, p.z, 0)) {
goto next;
}
}
}
printf("Seed %d has 0 villages!\n");
next:
;
if(seed % 100000 == 0){
auto checkpoint_end = high_resolution_clock::now();
auto duration = duration_cast<milliseconds>(checkpoint_end - start);
double sps = ((double)seed/(double)duration.count())*1000.0;
printf("Thread: %d Speed: %f sps\n", omp_get_thread_num(), sps);
}
}
}