diff options
| author | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-25 18:02:59 -0800 |
|---|---|---|
| committer | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-25 18:02:59 -0800 |
| commit | 50992a6ab44321fe925c2becaa856a31696076ea (patch) | |
| tree | 1a8e51b5fc37666f94a6b062de52a424a66b9cce /Source/Randomizer2Core.cpp | |
| parent | 81fa5933d23db320934d168329b818b1868eeb6c (diff) | |
| download | witness-tutorializer-50992a6ab44321fe925c2becaa856a31696076ea.tar.gz witness-tutorializer-50992a6ab44321fe925c2becaa856a31696076ea.tar.bz2 witness-tutorializer-50992a6ab44321fe925c2becaa856a31696076ea.zip | |
Simplified / added two more
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); |
