about summary refs log tree commit diff stats
path: root/Source/Randomizer2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Randomizer2.cpp')
-rw-r--r--Source/Randomizer2.cpp30
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
13Randomizer2::Randomizer2(const PuzzleSerializer& serializer) : _serializer(serializer) {} 10Randomizer2::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
264void Randomizer2::RandomizeKeep() { 284void Randomizer2::RandomizeKeep() {