about summary refs log tree commit diff stats
path: root/App/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'App/Main.cpp')
-rw-r--r--App/Main.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/App/Main.cpp b/App/Main.cpp index 7f15236..10aac89 100644 --- a/App/Main.cpp +++ b/App/Main.cpp
@@ -6,6 +6,7 @@
6#include "Random.h" 6#include "Random.h"
7#include "Randomizer.h" 7#include "Randomizer.h"
8#include "Randomizer2.h" 8#include "Randomizer2.h"
9#include "Panels_.h"
9 10
10#define HEARTBEAT 0x401 11#define HEARTBEAT 0x401
11#define RANDOMIZE_READY 0x402 12#define RANDOMIZE_READY 0x402
@@ -20,6 +21,7 @@
20#include "Solver.h" 21#include "Solver.h"
21#include "PuzzleSerializer.h" 22#include "PuzzleSerializer.h"
22#include <sstream> 23#include <sstream>
24#include <iomanip>
23 25
24#define TMP1 0x501 26#define TMP1 0x501
25#define TMP2 0x502 27#define TMP2 0x502
@@ -160,7 +162,29 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
160 } 162 }
161 break; 163 break;
162 case TMP3: 164 case TMP3:
163 Solver::Solve(g_puzzle); 165 {
166 for (auto [key, value] : PANELS) {
167 std::stringstream out;
168 std::string name(value);
169 out << " {'id': 0x" << std::hex << std::uppercase << std::setfill('0') << std::setw(5) << key << ", 'area':'";
170 int k;
171 for (k=0; name[k] != ' '; k++) out << name[k];
172 if (name[k+2] == ' ') {
173 out << name[k] << name[k+1];
174 k += 2;
175 }
176 out << "', 'name':'";
177 k++;
178 for (k; k < name.size(); k++) out << name[k];
179 out << "', 'data':'";
180 auto puzzle = PuzzleSerializer(g_witnessProc).ReadPuzzle(key);
181 out << puzzle.Serialize();
182 out << "'},\r\n";
183 DebugPrint(out.str());
184 }
185 }
186
187 // Solver::Solve(g_puzzle);
164 break; 188 break;
165 case TMP4: 189 case TMP4:
166 SetRandomSeed(); 190 SetRandomSeed();