From 059e44fa16b649938d79597bcf8f41bf4aa136ab Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Fri, 22 Nov 2019 10:04:19 -0800 Subject: fix more asymmetrical gap bugs --- Source/Randomizer2.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'Source/Randomizer2.cpp') 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() { Puzzle p; p.NewGrid(4, 4); p.symmetry = Puzzle::Symmetry::X; - + p.grid[0][8].start = true; + p.grid[8][8].start = true; + p.grid[2][0].end = Cell::Dir::UP; + p.grid[6][0].end = Cell::Dir::UP; + // @Bug: This can still make the puzzle unsolvable, if it leaves the centerline free -- even though two lines can't pass through the centerline. + // ^ Try seed = 13710 + std::vector cutEdges = Randomizer2Core::CutSymmetricalEdgePairs(p, 4); + for (int i=0; i<2; i++) { + Pos pos = cutEdges[i]; + p.grid[pos.x][pos.y].gap = Cell::Gap::BREAK; + } + for (int i=2; i<4; i++) { + Pos pos = cutEdges[i]; + Pos sym = p.GetSymmetricalPos(pos.x, pos.y); + p.grid[sym.x][sym.y].gap = Cell::Gap::BREAK; + } + + _serializer.WritePuzzle(p, 0x87); } } -- cgit 1.4.1