about summary refs log tree commit diff stats
path: root/Source/Solver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Solver.cpp')
-rw-r--r--Source/Solver.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/Solver.cpp b/Source/Solver.cpp index bce1482..a8710a2 100644 --- a/Source/Solver.cpp +++ b/Source/Solver.cpp
@@ -30,6 +30,7 @@ void Solver::SolveLoop(Puzzle& p, int x, int y, std::vector<Puzzle>& solutions)
30 if (p.sym == Puzzle::Symmetry::NONE) { 30 if (p.sym == 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 } else { 34 } else {
34 /* 35 /*
35 // Get the symmetrical position, and try coloring it 36 // Get the symmetrical position, and try coloring it
@@ -69,6 +70,7 @@ void Solver::SolveLoop(Puzzle& p, int x, int y, std::vector<Puzzle>& solutions)
69 70
70 // Tail recursion: Back out of this cell 71 // Tail recursion: Back out of this cell
71 p.grid[x][y].color = Cell::Color::NONE; 72 p.grid[x][y].color = Cell::Color::NONE;
73 p.sequence.pop_back();
72 if (p.sym != Puzzle::Symmetry::NONE) { 74 if (p.sym != Puzzle::Symmetry::NONE) {
73 /* 75 /*
74 auto sym = p.GetSymmetricalPos(x, y); 76 auto sym = p.GetSymmetricalPos(x, y);