-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_gen_d2.cpp
56 lines (45 loc) · 1.26 KB
/
main_gen_d2.cpp
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
48
49
50
51
52
53
54
55
56
#include <iostream>
#include <vector>
#include <list>
#include <random>
#include <algorithm>
#include <bitset>
#include <memory>
#include <sstream>
#include "codegen.h"
#include "mapgen.h"
#include <fstream>
const size_t rnd_seed = 0;
const size_t code_bits = 5;
const size_t num_levels2gen = 3;
int main(int argc, char* argv[]) {
std::vector<std::shared_ptr<Vertex> > gcode = generate_code_d2(rnd_seed, code_bits);
std::cout << "Generated code : ";
for (const auto& vrx : gcode) {
std::cout << (std::string)(*vrx) << " ";
}
std::cout << std::endl;
intersect_code_spheres(gcode, SP1xSP1);
std::cout << "Close spheres\n";
for (const auto& vrx : gcode) {
std::cout << vrx->string_w_sp1() << "\n";
}
std::cout << std::endl;
auto levelsmap = generate_map_from_code(rnd_seed, gcode, num_levels2gen, SP1xSP1);
std::cout << "Layers built\n";
size_t layer_idx = 0;
for (const auto& layer : levelsmap.levels) {
std::cout << "Layer " << layer_idx << ": ";
for (const auto& code : layer) {
std::cout << Vertex::to_string(code, code_bits) << " ";
}
std::cout << "\n";
layer_idx++;
}
std::cout << std::endl;
std::ofstream ofs("labyrinth.v");
generate_verilog_dnf(levelsmap, ofs);
ofs.close();
std::getchar();
return 0;
}