diff options
author | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-25 21:10:50 -0800 |
---|---|---|
committer | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-25 21:10:50 -0800 |
commit | ac83733b590f3c0750bea1de3556ceb24fa0a4b1 (patch) | |
tree | 74aa45ca76603f23c027478af4c2c5aa09eab11e /Source/Randomizer2.cpp | |
parent | e10243a64e0c6542c9b74c3bb95f5ebf4a3df7cb (diff) | |
download | witness-tutorializer-ac83733b590f3c0750bea1de3556ceb24fa0a4b1.tar.gz witness-tutorializer-ac83733b590f3c0750bea1de3556ceb24fa0a4b1.tar.bz2 witness-tutorializer-ac83733b590f3c0750bea1de3556ceb24fa0a4b1.zip |
Using PCH to clean up includes
Diffstat (limited to 'Source/Randomizer2.cpp')
-rw-r--r-- | Source/Randomizer2.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/Source/Randomizer2.cpp b/Source/Randomizer2.cpp index f93e4fd..4f0bad0 100644 --- a/Source/Randomizer2.cpp +++ b/Source/Randomizer2.cpp | |||
@@ -1,14 +1,11 @@ | |||
1 | #include "pch.h" | ||
1 | #include "Randomizer2.h" | 2 | #include "Randomizer2.h" |
2 | #include "PuzzleSerializer.h" | 3 | #include "PuzzleSerializer.h" |
3 | #include "Randomizer2Core.h" | 4 | #include "Randomizer2Core.h" |
4 | #include "Puzzle.h" | 5 | #include "Puzzle.h" |
5 | #include "Random.h" | 6 | #include "Random.h" |
6 | #include "Solver.h" | 7 | #include "Solver.h" |
7 | 8 | #include "Windows.h" | |
8 | #include <cassert> | ||
9 | #include <string> | ||
10 | |||
11 | #pragma warning (disable: 26451) | ||
12 | 9 | ||
13 | Randomizer2::Randomizer2(const PuzzleSerializer& serializer) : _serializer(serializer) {} | 10 | Randomizer2::Randomizer2(const PuzzleSerializer& serializer) : _serializer(serializer) {} |
14 | 11 | ||
@@ -229,6 +226,7 @@ void Randomizer2::RandomizeSymmetry() { | |||
229 | 226 | ||
230 | _serializer.WritePuzzle(p, 0x62); | 227 | _serializer.WritePuzzle(p, 0x62); |
231 | } | 228 | } |
229 | // TODO: Positioning is off, slightly -- which means you can start from the bottom left, if you peek around. | ||
232 | { // Back wall 5 | 230 | { // Back wall 5 |
233 | Puzzle p; | 231 | Puzzle p; |
234 | p.NewGrid(11, 8); | 232 | p.NewGrid(11, 8); |
@@ -259,6 +257,28 @@ void Randomizer2::RandomizeSymmetry() { | |||
259 | 257 | ||
260 | _serializer.WritePuzzle(p, 0x5C); | 258 | _serializer.WritePuzzle(p, 0x5C); |
261 | } | 259 | } |
260 | |||
261 | { // Rotational 1 | ||
262 | Puzzle p; | ||
263 | p.NewGrid(3, 3); | ||
264 | p.symmetry = Puzzle::Symmetry::XY; | ||
265 | p.grid[6][0].start = true; | ||
266 | p.grid[0][6].start = true; | ||
267 | p.grid[4][0].end = Cell::Dir::UP; | ||
268 | p.grid[2][6].end = Cell::Dir::DOWN; | ||
269 | |||
270 | p.grid[5][0].gap = Cell::Gap::BREAK; | ||
271 | p.grid[1][6].gap = Cell::Gap::BREAK; | ||
272 | |||
273 | for (Pos pos : Randomizer2Core::CutSymmetricalEdgePairs(p, 1)) { | ||
274 | std::string text = std::to_string(pos.x) + " " + std::to_string(pos.y); | ||
275 | OutputDebugStringA(text.c_str()); | ||
276 | p.grid[pos.x][pos.y].gap = Cell::Gap::BREAK; | ||
277 | Pos sym = p.GetSymmetricalPos(pos.x, pos.y); | ||
278 | p.grid[sym.x][sym.y].gap = Cell::Gap::BREAK; | ||
279 | } | ||
280 | _serializer.WritePuzzle(p, 0x8D); | ||
281 | } | ||
262 | } | 282 | } |
263 | 283 | ||
264 | void Randomizer2::RandomizeKeep() { | 284 | void Randomizer2::RandomizeKeep() { |