about summary refs log tree commit diff stats
path: root/Source/Randomizer2.cpp
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2019-11-22 10:04:19 -0800
committerjbzdarkid <jbzdarkid@gmail.com>2019-11-22 10:04:19 -0800
commit059e44fa16b649938d79597bcf8f41bf4aa136ab (patch)
tree255c9f256ecae0923e872e62ccaab48221f12743 /Source/Randomizer2.cpp
parentcbdf87bb8aaebca9c969dfec3c1664b9b6355a0d (diff)
downloadwitness-tutorializer-059e44fa16b649938d79597bcf8f41bf4aa136ab.tar.gz
witness-tutorializer-059e44fa16b649938d79597bcf8f41bf4aa136ab.tar.bz2
witness-tutorializer-059e44fa16b649938d79597bcf8f41bf4aa136ab.zip
fix more asymmetrical gap bugs
Diffstat (limited to 'Source/Randomizer2.cpp')
-rw-r--r--Source/Randomizer2.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/Randomizer2.cpp b/Source/Randomizer2.cpp index cc23c7d..c823567 100644 --- a/Source/Randomizer2.cpp +++ b/Source/Randomizer2.cpp
@@ -177,7 +177,24 @@ void Randomizer2::RandomizeSymmetry() {
177 Puzzle p; 177 Puzzle p;
178 p.NewGrid(4, 4); 178 p.NewGrid(4, 4);
179 p.symmetry = Puzzle::Symmetry::X; 179 p.symmetry = Puzzle::Symmetry::X;
180 180 p.grid[0][8].start = true;
181 p.grid[8][8].start = true;
182 p.grid[2][0].end = Cell::Dir::UP;
183 p.grid[6][0].end = Cell::Dir::UP;
184 // @Bug: This can still make the puzzle unsolvable, if it leaves the centerline free -- even though two lines can't pass through the centerline.
185 // ^ Try seed = 13710
186 std::vector<Pos> cutEdges = Randomizer2Core::CutSymmetricalEdgePairs(p, 4);
187 for (int i=0; i<2; i++) {
188 Pos pos = cutEdges[i];
189 p.grid[pos.x][pos.y].gap = Cell::Gap::BREAK;
190 }
191 for (int i=2; i<4; i++) {
192 Pos pos = cutEdges[i];
193 Pos sym = p.GetSymmetricalPos(pos.x, pos.y);
194 p.grid[sym.x][sym.y].gap = Cell::Gap::BREAK;
195 }
196
197 _serializer.WritePuzzle(p, 0x87);
181 } 198 }
182} 199}
183 200