about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2019-12-03 09:37:42 -0800
committerjbzdarkid <jbzdarkid@gmail.com>2019-12-03 09:37:42 -0800
commit00d641c5c70d1b1141dafb7b297ca18f259b6af0 (patch)
tree89ea1f880dfbdb373d9fda8faff8205ac696e46e
parent42d4067a16d826f0941d72df885111ef06ed3d7a (diff)
downloadwitness-tutorializer-00d641c5c70d1b1141dafb7b297ca18f259b6af0.tar.gz
witness-tutorializer-00d641c5c70d1b1141dafb7b297ca18f259b6af0.tar.bz2
witness-tutorializer-00d641c5c70d1b1141dafb7b297ca18f259b6af0.zip
Uncomment symmetry for traversal
-rw-r--r--Source/Solver.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/Source/Solver.cpp b/Source/Solver.cpp index ac660a2..2813027 100644 --- a/Source/Solver.cpp +++ b/Source/Solver.cpp
@@ -32,7 +32,6 @@ void Solver::SolveLoop(Puzzle& p, int x, int y, std::vector<Puzzle>& solutions)
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(x, y); 33 p.sequence.emplace_back(x, y);
34 } else { 34 } else {
35 /*
36 // Get the symmetrical position, and try coloring it 35 // Get the symmetrical position, and try coloring it
37 auto sym = p.GetSymmetricalPos(x, y); 36 auto sym = p.GetSymmetricalPos(x, y);
38 Cell::Color oldColor = p.GetLine(sym.x, sym.y); 37 Cell::Color oldColor = p.GetLine(sym.x, sym.y);
@@ -40,11 +39,10 @@ void Solver::SolveLoop(Puzzle& p, int x, int y, std::vector<Puzzle>& solutions)
40 39
41 // Collided with ourselves or our reflection 40 // Collided with ourselves or our reflection
42 if (cell.color != Cell::Color::NONE) { 41 if (cell.color != Cell::Color::NONE) {
43 p.grid[sym.x, sym.y].color = oldColor; 42 p.grid[sym.x][sym.y].color = oldColor;
44 return; 43 return;
45 } 44 }
46 p.grid[x][y].color = Cell::Color::BLUE; // Otherwise, mark this cell as visited 45 p.grid[x][y].color = Cell::Color::BLUE; // Otherwise, mark this cell as visited
47 */
48 } 46 }
49 47
50 if (cell.end != Cell::Dir::NONE) { 48 if (cell.end != Cell::Dir::NONE) {
@@ -72,9 +70,7 @@ void Solver::SolveLoop(Puzzle& p, int x, int y, std::vector<Puzzle>& solutions)
72 p.grid[x][y].color = Cell::Color::NONE; 70 p.grid[x][y].color = Cell::Color::NONE;
73 p.sequence.pop_back(); 71 p.sequence.pop_back();
74 if (p.symmetry != Puzzle::Symmetry::NONE) { 72 if (p.symmetry != Puzzle::Symmetry::NONE) {
75 /*
76 auto sym = p.GetSymmetricalPos(x, y); 73 auto sym = p.GetSymmetricalPos(x, y);
77 p.grid[sym.x][sym.y].color = Cell::Color::NONE; 74 p.grid[sym.x][sym.y].color = Cell::Color::NONE;
78 */
79 } 75 }
80} 76}