-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
36 lines (30 loc) · 1.37 KB
/
main.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
// #define NDEBUG // uncomment to disable asserts
#include "Algorithm.h"
#include "Blindsolving.h"
#include "RunTests.h"
#include "SolveAttemptParsingUtils.h"
#include <iostream>
static void viewReconstruction(const std::string& file_name) {
using namespace blindsolving;
const auto [scramble_str, solve_str] = utility::loadScrambleSolve(file_name);
const Algorithm scramble = Algorithm::parse(scramble_str);
// use parseExpanded for the attempted solution so that the division between
// blindsolving moves can easily be determined
const Algorithm solve = Algorithm::parseExpanded(solve_str);
const Reconstruction reconstruction = parseSolveAttempt(solve);
std::cout << "Attempt reconstruction:\n" << reconstruction.toStr() << '\n';
ReconstructionIterator it = getReconstructionIterator(Cube{scramble});
std::cout << "Processing " << it.getPeriod() << " reconstructions...\n";
const size_t n = std::min(it.getPeriod(), 3ull);
const std::vector<std::pair<BlindsolvingReconstruction, size_t>>
best_reconstructions = getBestReconstructions(reconstruction, it, n);
std::cout << "Closest reconstruction matches:\n";
for (const auto& [recon, edit_distance] : best_reconstructions)
std::cout << "Edit distance: " << edit_distance << ", " << recon.toStr()
<< '\n';
}
int main() {
runTests();
viewReconstruction("tests/blindsolve3.txt");
return 0;
}