diff options
Diffstat (limited to 'Source/Randomizer2Core.cpp')
| -rw-r--r-- | Source/Randomizer2Core.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
| diff --git a/Source/Randomizer2Core.cpp b/Source/Randomizer2Core.cpp index ceb726b..eaefa9a 100644 --- a/Source/Randomizer2Core.cpp +++ b/Source/Randomizer2Core.cpp | |||
| @@ -18,17 +18,9 @@ std::vector<Pos> Randomizer2Core::CutSymmetricalEdgePairs(const Puzzle& p, size_ | |||
| 18 | Puzzle copy = p; | 18 | Puzzle copy = p; |
| 19 | assert(p.symmetry != Puzzle::Symmetry::NONE); | 19 | assert(p.symmetry != Puzzle::Symmetry::NONE); |
| 20 | if (p.symmetry == Puzzle::Symmetry::X) { | 20 | if (p.symmetry == Puzzle::Symmetry::X) { |
| 21 | if (p.width%4 == 1) { | 21 | // Prevent cuts from landing on the midline |
| 22 | // The puzle has an even width (e.g. 4x4), so it has a midline for symmetry. | 22 | for (int y=0; y<p.height; y++) { |
| 23 | // Since this midline is unusable, we cut it pre-emptively. | 23 | copy.grid[p.width/2][y].gap = Cell::Gap::FULL; |
| 24 | for (int y=0; y<p.height; y++) { | ||
| 25 | copy.grid[p.width/2][y].gap = Cell::Gap::FULL; | ||
| 26 | } | ||
| 27 | } else { | ||
| 28 | // The puzzle has an odd width (e.g. 3x3), but we still need to cut the midline. | ||
| 29 | for (int y=0; y<p.height; y++) { | ||
| 30 | copy.grid[p.width/2][y].gap = Cell::Gap::FULL; | ||
| 31 | } | ||
| 32 | } | 24 | } |
| 33 | 25 | ||
| 34 | return CutEdgesInternal(copy, 0, (p.width-1)/2, 0, p.height, numEdges); | 26 | return CutEdgesInternal(copy, 0, (p.width-1)/2, 0, p.height, numEdges); |
