diff options
author | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-20 10:05:59 -0800 |
---|---|---|
committer | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-20 10:05:59 -0800 |
commit | 6f0a34bfb761d965bd961dc1f880b84e35f9959f (patch) | |
tree | 9fad4b4d98f5cb644b635c017a959dd3752a0399 /Source/Solver.cpp | |
parent | ab5652329d3e6bbaaf338e47fb3d84d89bf9b7b1 (diff) | |
download | witness-tutorializer-6f0a34bfb761d965bd961dc1f880b84e35f9959f.tar.gz witness-tutorializer-6f0a34bfb761d965bd961dc1f880b84e35f9959f.tar.bz2 witness-tutorializer-6f0a34bfb761d965bd961dc1f880b84e35f9959f.zip |
Understanding symmetry, but nothing else.
Diffstat (limited to 'Source/Solver.cpp')
-rw-r--r-- | Source/Solver.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Solver.cpp b/Source/Solver.cpp index a8710a2..c0b35ef 100644 --- a/Source/Solver.cpp +++ b/Source/Solver.cpp | |||
@@ -27,10 +27,10 @@ void Solver::SolveLoop(Puzzle& p, int x, int y, std::vector<Puzzle>& solutions) | |||
27 | if (cell.undefined) return; | 27 | if (cell.undefined) return; |
28 | if (cell.gap != Cell::Gap::NONE) return; | 28 | if (cell.gap != Cell::Gap::NONE) return; |
29 | 29 | ||
30 | if (p.sym == Puzzle::Symmetry::NONE) { | 30 | if (p.symmetry == Puzzle::Symmetry::NONE) { |
31 | if (cell.color != Cell::Color::NONE) return; // Collided with ourselves | 31 | if (cell.color != Cell::Color::NONE) return; // Collided with ourselves |
32 | p.grid[x][y].color = Cell::Color::BLACK; // Otherwise, mark this cell as visited | 32 | p.grid[x][y].color = Cell::Color::BLACK; // Otherwise, mark this cell as visited |
33 | p.sequence.emplace_back(Pos{x, y}); | 33 | p.sequence.emplace_back(x, y); |
34 | } else { | 34 | } else { |
35 | /* | 35 | /* |
36 | // Get the symmetrical position, and try coloring it | 36 | // Get the symmetrical position, and try coloring it |
@@ -71,7 +71,7 @@ void Solver::SolveLoop(Puzzle& p, int x, int y, std::vector<Puzzle>& solutions) | |||
71 | // Tail recursion: Back out of this cell | 71 | // Tail recursion: Back out of this cell |
72 | p.grid[x][y].color = Cell::Color::NONE; | 72 | p.grid[x][y].color = Cell::Color::NONE; |
73 | p.sequence.pop_back(); | 73 | p.sequence.pop_back(); |
74 | if (p.sym != Puzzle::Symmetry::NONE) { | 74 | if (p.symmetry != Puzzle::Symmetry::NONE) { |
75 | /* | 75 | /* |
76 | auto sym = p.GetSymmetricalPos(x, y); | 76 | auto sym = p.GetSymmetricalPos(x, y); |
77 | p.grid[sym.x][sym.y].color = Cell::Color::NONE; | 77 | p.grid[sym.x][sym.y].color = Cell::Color::NONE; |