From 0baa521ba34d2cd4e0f732f83d23b807605786a2 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Sat, 16 Nov 2019 10:27:06 -0800 Subject: More and more progress. Split out functions in serializer Figured out how to allocate memory (for sequences) --- Source/Solver.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Source/Solver.cpp') 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& solutions) if (p.sym == Puzzle::Symmetry::NONE) { if (cell.color != Cell::Color::NONE) return; // Collided with ourselves p.grid[x][y].color = Cell::Color::BLACK; // Otherwise, mark this cell as visited + p.sequence.emplace_back(Pos{x, y}); } else { /* // Get the symmetrical position, and try coloring it @@ -69,6 +70,7 @@ void Solver::SolveLoop(Puzzle& p, int x, int y, std::vector& solutions) // Tail recursion: Back out of this cell p.grid[x][y].color = Cell::Color::NONE; + p.sequence.pop_back(); if (p.sym != Puzzle::Symmetry::NONE) { /* auto sym = p.GetSymmetricalPos(x, y); -- cgit 1.4.1